Run Another Program

Initiates an external application with optional command-line arguments.

 

Input Arguments

 

0

File Path or Embedded File

Program Path

The path to the program to execute.

1

String

Command Line Arguments (optional)

Optional command-line arguments to pass to the executing program.

2

Boolean

Wait for Program Completion

Indicates whether the MP should pause until the

program finishes.

3

Integer

Process Exit Code

Windows Process Exit Code return as part of trying to run the application.

Return Arguments

None.

 

Returned Status

 

SUCCESS

The program was executed successfully.

FAILURE

The program could not be found or executed.

Remarks

This command supports both absolute paths (ex. C:\test.exe) and relative paths (ex. .\test.exe). If a rela- tive path is provided and the MP is embedded, the path will be relative to the current SA file location.

The file to execute does not necessarily need to be an executable (.exe) file. Batch files (.BAT), VBScript files (.VBS), and other file types that execute when double-clicked will work with this command.

Command line arguments should not be enclosed in quotes. If more than one argument is provided, separate them by a space--not a comma. For example, to run a program with two command-line arguments, argument #1 might be

-x file.txt.

If the Wait for Program Completion argument is set to TRUE, the MP will pause while the other program is running and SA will not receive events from Windows. As a result, SA will appear to have hung or crashed. This is normal, and once the application completes and returns control back to SA, the interface will be updated and become responsive again. For this reason, it is recommended to minimize the SA interface (using the Set SA’s Window State command) prior to running an external program with this method.

If the Wait for Program Completion argument is set to FALSE, the MP will start to execute the specified program and immediately continue to the next step in the MP.

Process Exit Code is a windows process level integer error code returned as part of any attempt to run a separate pro- gram. It returns values such as:

  1. Operation completed successfully

  2. Incorrect function.

  3. System cannot find the file specified

    ... (a full listing can be found from Microsoft).