vb error help 0x80041017

msg=inputbox("Enter Process")
strComputer = "."
strProcess ="''" + msg

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

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcess )

For Each objProcess in colProcess
 objProcess.Terminate()
 WScript.Echo "Killed Process: " & objProcess.Name & vbTab &

objProcess.ProcessId
Next

This is a script mod so i can type a procces to kill and it will kill it but it come up with a error 0x80041017 I need help here is the original

strComputer = "."
strProcess = "'wscript.exe'"

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

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcess )

For Each objProcess in colProcess
 objProcess.Terminate()
 WScript.Echo "Killed Process: " & objProcess.Name & vbTab & objProcess.ProcessId
Next


Also i am a noob at this
July 11th, 2013 7:00am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics