Dim wsh, blnAppRunning
If WScript.Arguments.Count <> 1 Then
	WScript.Echo "Kills all instances of an application. Usage:" & vbCrLf & Ucase(WScript.ScriptName) & " ""Window Title""" & vbCrLf & "Where ""Window Title"" is the complete, beginning, or end title bar text of the application you want to kill."
Else
	Set wsh = CreateObject("Wscript.Shell")
	blnAppRunning = True
	Do While blnAppRunning = True
		blnAppRunning = wsh.AppActivate(WScript.Arguments(0))
		If blnAppRunning Then
			Wscript.Sleep 200 'give time for focus shift
			wsh.SendKeys "%{F4}"
		End If
		WScript.Sleep 500
	Loop
End If
