Runs an external program and pauses script execution until the program finishes.
RunWait ( "filename" [, "workingdir" [, flag]] )
Parameters
filename | The name of the executable (EXE, BAT, COM, PIF) to run. |
workingdir | [optional] The working directory. |
flag | [optional] The "show" flag of the executed program: @SW_HIDE = Hidden window @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized window |
Return Value
Success: | Returns the exit code of the program that was run. |
Failure: | Depends on RunErrorsFatal; see Remarks. |
Remarks
To run DOS commands, try RunWait(@ComSpec & " /c " & "commandName")
Related
ProcessWait, ProcessWaitClose, RunAsSet, RunErrorsFatal (Option), RunWait
Example
$val = RunWait("Notepad.exe", "C:\WINDOWS", @SW_MAXIMIZE)
; script waits until Notepad closes
MsgBox(0, "Program returned with exit code:", $val)