RunWait

Runs a program as a normal window, and waits for it to close.

Syntax:

RunWait (program-name, parameters)

Parameters:

(s) program-name the name of the desired .EXE, .COM, .PIF, .BAT, .CMD file or a data file.

(s) parameters optional parameters as required by the application.

Returns:

(i) @TRUE if the program was found.; @FALSE if it wasn't.

 

Use this command to run an application. The WIL program will suspend processing until the application is closed.

If the drive and path are not part of the program name, the current directory will be examined first, followed by the Windows and Windows System directories, and then the DOS path will be searched to find the desired executable file.

If the "program-name" has an extension other than .EXE, .COM, .PIF, .BAT or .CMD, it will be run with the associated application.

Example:

RunWait(Environment("COMSPEC"), "/c dir *.exe>temp.txt")
Print("temp.txt","",@NORMAL,0)
WinWaitClose("~Notepad")
FileDelete("temp.txt")

See Also:

RunShell, AppWaitClose, Run, RunHideWait, RunIconWait, RunZoomWait, RunWithLogon, ShellExecute WinWaitClose, WinWaitExist, ShellExecWait, IntControl 64