Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot kill a system process using wmi

Status
Not open for further replies.

LMichel

IS-IT--Management
Apr 2, 2001
85
0
0
BE
I try to use the following code to kill a process:


-------------------------

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

strProcessKill = "'cpqalert.exe'"

Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
Next
WSCript.Echo "Just killed process " & strProcessKill & " on " & strComputer

-------------------------

It's works fine for a process running under my account but not for system account.
Do I need extra previleges ?

 
Try explicit assert debug privilege.
[tt]
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate[blue],(debug)[/blue]}!\\" & strComputer & "\root\cimv2")
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top