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 ?
-------------------------
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 ?