Function CommandExists(strCommand, strProof) 'Returns true if a command line utility will run. 'Enter the command and some text that appears in the command output. Dim strData, app, ws, intMaxCount, intCount On Error Resume Next Set ws = CreateObject("Wscript.Shell") strData = "" intMaxCount = 10 intCount = 0 Err.Clear Set app = ws.Exec(strCommand) If Err.Number = 0 Then Do While app.Status = 0 WScript.Sleep 100 intCount = intCount + 1 'Keep track of how many times we've waited. If intCount > intMaxCount Then Exit Do 'Don't get stuck waiting for user input. Loop strData = app.StdOut.ReadAll strData = strData & app.StdErr.ReadAll End If If strData = "" Then CommandExists = False Else If InStr(strData, strProof) = 0 Then CommandExists = False Else CommandExists = True End If End If End Function