Navigation: Actions > System > Run Program Action |
|
The Run Program action creates a step to launch any external application, program, batch file, or command script. Visual Build starts and monitors the application, captures any output and logs it to the Output pane (and a log file if enabled), and terminates the application if the build is stopped.
When the step completes, the following temporary macros are created or updated:
• | RUNPROGRAM_EXITCODE: If the Wait option is checked, the exit code of the process will be stored in this macro. |
• | RUNPROGRAM_PROCESSID: If the Wait option is unchecked, the process ID of the launched process will be stored in this macro. |
Note: To run batch files (.bat), command scripts (.cmd), or individual shell commands, use the Batch File action. If using the Run Program action, the command should be prefixed with the DOSCMD system macro (i.e., %DOSCMD% call "C:\path\to\file.bat" arg1 "arg 2" or %DOSCMD% copy "%PROJDIR%\Test.exe" "\\server\deploy") so that the command is executed under a command shell/interpreter. Also, if you wish to execute multiple commands (& [run both], && [run second command if first succeeds], or || [run second command if first fails]), redirect output (> or >>), or use piping (|) on the output of an executable, the command should also be prefixed with DOSCMD, since the command interpreter is what implements these capabilities.
Note: To call the 64-bit version of cmd.exe when using the DOSCMD system macro, create a COMSPEC global macro with a value of %WINDIR%\Sysnative\cmd.exe.