I have a very simple script that I'm testing out to include in a much
larger script, it is a very simple terminate process request for
DLLHOST.EXE or dllhst3g.exe.
The script runs with no errors but it just not terminate the process,
can anyone tell me what I'm missing here:
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
strComputer = "."
strProcessKill = " 'dllhst3g.exe' "
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
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
WScript.Quit