EXEC Execute an external program |
Top Previous Next |
This script command executes a specified external program.
The /nowait option determines if the script file execution is suspended until the external program is complete or continues to run. If this option is omitted, script file execution resumes when the program terminates.
The /passargs option allows you to pass any number of variable or string values from the script file to the program to be executed as if they are specified on the Shortcut Target command line. Any variables or string values that follow the /passargs delimiter within the EXEC command line are passed in this way. Consider the following example.
SET program_name = "myprog.exe -abc" SET flag = "-xyz" EXEC program_name /passargs "-p2" flag
The effective command line to the program myprog.exe would be:
myprog.exe -abc -p2 -xyz
The exit value of the executed program is obtained by Robo-FTP when it terminates and it becomes the EXEC command’s result code. This result code may be useful in subsequent conditional branching tests in the script file.
This option permits an external program to deal specifically with a particular error condition that may be beyond the scope of a Robo-FTP script file.
The /timeout option allows you to specify the maximum amount of time to wait for the program to complete. This option is useful for protecting your command script from an unreliable external program. If you do not specify a timeout and the external program hangs without exiting then Robo-FTP will wait indefinitely.
Related Command(s): CALL, CHAIN, DOSCMD, WORKINGDIR Also: Script File Result Codes |