VBScript to Kill a Process
This worked great for me. Just use as function and kill as many processes as you like. KillProc "abc.exe" Sub KillProc( myProcess ) Dim blnRunning, colProcesses, objProcess blnRunning = False Set colProcesses = GetObject( _ "winmgmts:{impersonationLevel=impersonate}" _ ).ExecQuery( "Select * From Win32_Process", , 48 ) For Each objProcess in colProcesses If LCase( myProcess ) = LCase( objProcess.Name ) Then ' Confirm that the process was actually running blnRunning = True ...