Function reference
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’ )
Argument | Description |
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.
Example 1
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’ )
.
Example 2
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 ..