On Error Resume Next If WScript.Arguments.Count <> 1 Then WScript.Echo "Kills all instances of an application. Usage:" & vbCrLf & Ucase(WScript.ScriptName) & " ""Program.exe""" & vbCrLf & "Where ""Program.exe"" is the executable name of the application you want to kill." Else Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Set colItems = objWMIService.ExecQuery("Select Name from Win32_Process where Name='" & Wscript.Arguments(0) & "'",,48) For Each objItem in colItems objItem.Terminate Next End If