Dim WshShell, oExec Set WshShell = CreateObject("WScript.Shell") waitms="5000" do Set oExec = WshShell.Exec(".\qsgrabber.exe "+waitms) do While oExec.Status = 0 WScript.Sleep 100 loop waitms="2000" loop while oExec.ExitCode=2