Runs an external program and wait for it to complete. A return value can optionally be communicated using a dynamically generated Registry Key.
RunProgram ( ‘Exe ‘ , ‘Argument’ , ‘Timeout’ , ‘VisualMode’ , ‘GetReturnValue’ )
|Exe||The path and file name for the program to run.|
|Argument||The argument for the program.|
|Timeout||How many seconds to wait for the program to complete before an error is generated. (‘0’ = infinite)|
|VisualMode||How the program should run. Valid values are: Hidden , Normal , Maximized , Minimized|
|GetReturnValue||Use a system controlled Registry Key to communicate the programs return value. If ‘true’, argument 1, sent to the program, is the Registry Key the program should use to return a result.|
Any windows program can be called.
To use the built in communication feature for returning a value, the program must write the return value to the Registry on the key that is passed in the first argument when this functionality is enabled. se the supplied Visual Studio project for details.
This example will run the installed demo program MyProgram.exe (from the sample VS project) and retrieve the returned value using the dynamically generated Registry Key.
If the program has not completed in 30 seconds or terminates unexpected an error will be generated.
RunProgram( [<< FolderProgram >>] + ‘\MyProgram.exe’ , ‘My arguments’ , ‘30’ , ‘Normal’ , ‘true’ )
This example will assign the parameter
[<MyParam>] with the return value from MyProgram.exe
0 = No timeout.
[<MyParam>] = RunProgram( [<< FolderProgram >>] + ‘\MyProgram.exe’ , ‘My arguments’ , ‘0’ , ‘Normal’ , ‘true’ )
Need more help with this?
Don’t hesitate to contact us here.