Run CMD Activity
The Run CMD activity enables the execution of commands and programs through the Windows Command Prompt interface. It allows users to automate command-line operations, manage external executables, and control process flow based on execution status.
| Field | Description | Requirement |
|---|---|---|
| Exe Name | Specifies the name of the program or command to be executed via the command line. | Required |
| Working Directory | Defines the file system path where the command or program will be initiated. | Required |
| Wait Until Finish | Determines if the workflow should pause until the command execution is complete. | Optional |
| Run as Admin | Enables the execution of the command with administrative privileges. | Optional |
| Parameters | Defines the arguments or flags passed to the executable program. | Optional |
| Result Variable Name | The name of the variable where the execution output or status is stored. | Optional |
Action Types & Examples
Exe Name
- Format: string
- Example Result: "cmd.exe"
Working Directory
- Format: string (path)
- Example Result: "C:\Temp"
Wait Until Finish
- Format: boolean
- Example Result: "true"
Parameters
- Format: string
- Example Result: "C:\ebyn\bdp.bat"
Implementation Examples
Field Setup - Set Exe Name to QAD.Applications.exe. - Set Working Directory to C:\ebyn. - Set Parameters to MD Trial.
Execution Parameters - Set Wait Until Finish to true to ensure the process completes before proceeding to the next step. - Set Run as Admin to true for tasks requiring elevated permissions. - Set Result Variable Name to cmdOutput.
Technical Notes
When the Run as Admin option is enabled, the Windows User Account Control (UAC) settings must be configured to the minimum level ("Never notify") to ensure uninterrupted execution. If Wait Until Finish is set to "false", the workflow will proceed to the subsequent activity immediately after the command is triggered, without waiting for the program to terminate.