Pages

Thursday, 23 July 2009

Kill Process -VBScript

Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
strProcessKill = "'crvw.exe'"
Set objWMIService = GetObject("winmgmts:root\cimv2")
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
Next
WScript.Quit

No comments:

Post a Comment