Re: How can I kill a stuck cmd.exe remotely?
- From: "Scott McNairy \(MVP\)" <v-scomcn@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 12 Apr 2005 12:37:24 -0700
You would want to use the Win32_process.Terminate method, the class resides
in the root\cimv2 namespace.
sample script code...
set svc = getObject("winmgmts:root\cimv2")
set objEnum = svc.ExecQuery("Select * from win32_process where caption =
'calc.exe'")
for each obj in objEnum
obj.Terminate(1)
next
WMI is available for NT4 but has to be installed separately, I believe that
it is a part of the NT4 SP4 installation media. If not, you can download it
from this location.
http://www.microsoft.com/downloads/details.aspx?FamilyID=afe41f46-e213-4cbf-9c5b-fbf236e0e875&displaylang=en
--
Scott McNairy
Microsoft MVP - Windows Server Management Infrastructure
"cschang" <cschang@xxxxxxxxxxxx> wrote in message
news:113sgi458u3m52b@xxxxxxxxxxxxxxxxxxxxx
> On my NT 4 server with sp6, I set up a scheduled task to run a cmd job
> regularly, which includes a bunch of commands and exe files. Sometimes,
> the cmd would stuck for some reasons I did not know. The only solution I
> did was to using the task manager to kill that cmd process locally. I want
> to know how I can set a process (using the WSHost script) to kill that
> cmd remotely from my Windows 2000 station. I have that killProc.vbs
> locally. How can I set up so that the script file will connect to that NT
> 4 server and kill the stuck cmd. Does the NT 4 server need to install
> something in order to run the WMI thing? Or the WMI process is not
> available on NT platform? Thanks.
>
> C Chang
.
- Prev by Date: Re: Win32Reg_AddRemovePrograms
- Next by Date: Re: User rigths for WMI access
- Previous by thread: Re: Win32Reg_AddRemovePrograms
- Next by thread: delete file using wmi
- Index(es):
Relevant Pages
|