If WScript.Arguments.Count <> 1 Then
    WScript.Echo "Waits for an application to shut down. Usage:" & vbCrLf & Ucase(WScript.ScriptName) & " ""Window Title""" & vbCrLf & "Where ""Window Title"" is the complete, beginning, or end text to an application's title bar."
Else
    Do
        If Not CreateObject("Wscript.Shell").AppActivate(WScript.Arguments(0)) Then Exit Do
        WScript.Sleep 500
    Loop
End If

