Have Questions?  Need Expert Answers?  JOIN LUNCH N' LEARNS!

Execute Command

Prev Next

Step Details

Introduced in Version4.0.0
Last Modified in Version7.12.0
LocationFlow Management

The Execute Command step runs a command executable on the server, similar to the Run Command Program on a File step. The main difference is that Execute Command does not require a file input; instead, it runs the executable specified in Command with optional arguments from ParameterString.

Important: Command execution is disabled by default for security reasons. Enable it in Settings.xml by adding (if missing) or setting the following tag:
<AllowCommandExecutionInSteps>true</AllowCommandExecutionInSteps>

Properties

Setup

PropertyDescriptionData Type
CommandThe absolute path to the command executable to run. Supported types include .bat, .cmd, and .exe. Network share (UNC) paths (for example, \\server\share\file.bat) are supported; mapped drive letters are not supported.String
ParameterStringOptional command parameters, separated by spaces (for example, flags, arguments, or values accepted by the executable).String
Get Command and Arguments from FlowRetrieves the inputs for Command and ParameterString through the Flow.Boolean

Note: Relative paths are not supported for Command.

Outputs

PropertyDescriptionData Type
ErrorCodeReturned when the command fails to execute.---

CommandErrorOutput
The error output produced by the command (stderr), when available.String

CommandOutput
The standard output produced by the command (stdout), when available.String

ReturnCode
The return/exit code produced by the executable, when available.String
SuccessReturned when the command executes successfully.---

CommandOutput
The standard output produced by the command (stdout), when available.String

Example

The following example shows sample values for the Command and ParameterString inputs.

PropertyExample Value
CommandC:\Windows\System32\cmd.exe
ParameterString/c echo Hello World >> C:\Examples\testing.txt


Common Errors

Command execution is disabled

This error occurs when command execution is disabled for security reasons. Enable it in Settings.xml by adding (if missing) or setting the following tag:

<AllowCommandExecutionInSteps>true</AllowCommandExecutionInSteps>

Could not find the file specified

A standard error when utilizing the step is an incomplete or incorrect path to the executable. Ensure that the full path in Command is complete and includes the correct file extension, and that the path is accessible to the Decisions service account. This message can be found in the CommandErrorOutput.