The Run action is used to start an application or open a document. This includes the option to open a console application in order to capture the output to a variable or file.
The 'Run' action can be set to wait until the specified application is ready for input, wait until it completes, or not wait at all. You can populate variables or a dataset with captured data from a particular window or process.
NOTE: Any variables used must be created in earlier steps using the Create Variable action.
From the Task Builder Available Actions pane, open the System folder and double-click the Run action or drag it into the Steps pane. The properties window of this action appears as shown below:
In the General tab, use one of the following ways to select the program, document or file to run:
Click the Start button , point to Programs or Settings and navigate to and select the program, document or file to run.
Click the Open Folder button , and navigate to the program or document.
Manually enter the full path and file name in the Run field.
If you want the program to open only if it is not already open, enable the option labeled Run only if another instance is not running.
If the window will not be in its normal state when the step runs (i.e. the window is currently maximized, minimized or hidden), select the applicable window state in the Initial window state drop-down. This is helpful, for example, when corresponding actions need to interact with the specified window.
Certain applications, primarily legacy (older) applications, may require a startup folder. However, most newer applications do not rely on a startup folder. If the program or document you wish to run needs a startup folder, click the Open Folder button next to the Startup folder field and navigate to the startup folder or manually enter the full path to the startup folder.
Click the Wait tab and make your selections according to the following "wait" guidelines:
Do not wait: When this parameter is enabled, the 'Run' step does not wait for certain application condition to occur (i.e. wait for the application to complete). In this case, the following step is executed immediately.
Wait until application is ready for input (default setting): When this parameter is enabled, the 'Run' step will pause until the specified application is open and ready for input. Enabling this parameter is useful ideally when corresponding task steps are used to interact with the window being opened.
When the Wait until application is ready for input parameter is enabled, the option Populate variable with the return code becomes available. To populate a variable with the process ID, select the corresponding check box and then manually enter or select the variable in the field below.
Wait until application ends: When this parameter is enabled, task execution will pause until the specified application closes.
When the Wait until application ends parameter is enabled, the option Populate variable with process ID becomes available. To populate a variable with the return code, select the check box and then select or enter the variable in the field below.
NOTE: Not all applications use return codes, so this functionality may vary from application to application.
The Data tab allows certain window parameters to be captured and saved to a variable or dataset. Make your selections according to the following guidelines:
The check boxes, Populate variable with window class, Populate variable with window handle, and Populate variable with window title are available only if Wait until application is ready for input is selected in the Wait tab. Use these check boxes to select the desired options and then select or enter the variable to populate in the corresponding field.
To populate a dataset with the application data, select Create and populate dataset, and then enter a name for the dataset in the field below. The dataset will store the title, class, and handle for the specified window as well as the process ID and return code for the process.
names must be alphanumeric, begin with a letter and contain no spaces.
If you want the program to run as a document or as a console application, click the Advanced tab and make your selection from the Run application as drop-down. By default, this parameter is set to Standard Windows application.
When the option labeled Console application is selected, other parameters become available. If you want to capture the output of the console application to a variable or file, enter the properties as follows:
To populate a variable, enable Capture output and populate variable, and then select or enter the variable in the box below.
To write the output to a file, select Capture output and write to file. Thereafter, click the Open Folder button, navigate to the file location, and select the file name or simply enter the full path to the file name in the provided field. If you want to overwrite any existing file, enable the option Overwrite if file already exists.
To set the Description tab properties, please refer to Description Tab Options.
To set the Error Causes and On Error tab properties, please refer to Step Error Handling.
When finished, click OK to save settings and close the properties dialog window.
Adding Task Steps