Hello,
I use this vbscript to kill two processes calc.exe and freecell.exe and it works fine.
But if I convert it into an HTA, it only kills one process.
Does anyone know why?
Thanks,
Here is the script.
‘’’’beginning of the script’’’’
On Error Resume Next
strComputer = "."
arrTargetProcs = Array("calc.exe","freecell.exe")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
For Each strTargetProc In arrTargetProcs
Set colProcesses = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process WHERE Name='" & strTargetProc & "'")
For Each objProcess in colProcesses
objProcess.Terminate
Next
Next
’’end of script’’’’
I use this vbscript to kill two processes calc.exe and freecell.exe and it works fine.
But if I convert it into an HTA, it only kills one process.
Does anyone know why?
Thanks,
Here is the script.
‘’’’beginning of the script’’’’
On Error Resume Next
strComputer = "."
arrTargetProcs = Array("calc.exe","freecell.exe")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
For Each strTargetProc In arrTargetProcs
Set colProcesses = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process WHERE Name='" & strTargetProc & "'")
For Each objProcess in colProcesses
objProcess.Terminate
Next
Next
’’end of script’’’’