smitad
13 years agoOccasional Contributor
Killing a process from Task Manager
Hi,
I want to kill a exe from windows task manager. I used WMI. Following is the code
ProcessList = GetObject("winmgmts://.").InstancesOf("win32_process")
Process ProcessList
Process.Name = KillProcess
im getting an error n line 2 OLE Error 80041002 and a vbscript runtime error. all I want to do is kill CPR_GUI exe using test complete. If anyone has done this without error, please let me know how did you acheive it.
Regards
Smita
I want to kill a exe from windows task manager. I used WMI. Following is the code
Killprocess = "CPR_GUI.exe"
Set ProcessList = GetObject("winmgmts://.").InstancesOf("win32_process")
ProcessList = GetObject("winmgmts://.").InstancesOf("win32_process")
For Each Process In ProcessList
Process ProcessList
If Process.Name = KillProcess Then
Process.Name = KillProcess
Process.Terminate
End If
Next
im getting an error n line 2 OLE Error 80041002 and a vbscript runtime error. all I want to do is kill CPR_GUI exe using test complete. If anyone has done this without error, please let me know how did you acheive it.
Regards
Smita