EXEC        Execute an external program

Top  Previous  Next

Syntax:

EXEC

[ exec name ]  [ /options ]

Arguments:

[ exec name ]

Variable or string defining a file or path name of an executable program including any program command line arguments; if no path is defined Robo-FTPs working folder is used; MS-DOS internal commands such as dir are not supported.

Options:

/nowait

Continue script execution after starting external program.

 

/passargs

Any subsequent variables or strings following this option are passed as arguments to the program to be run.

 

/passerror

Pass the result code from the last script command as an argument to the executed program.

 

 

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 commands 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.

 

Related Command(s): CALL, CHAIN, DOSCMD, WORKINGDIR  Also: Script File Result Codes