Using the Windows Command Task

The Windows Command Task is a control flow component that can be used to run windows and powershell commands to directly at the control flow level. It can be used to execute queries, and also to get the output in a required manner.

There are two pages that can be configured.

  • General
  • Output

General Page

The General page includes the general properties for the component.

Windows Command Task - General.png

Executable

The Executable drop-down displays a list of all executables that are available. You could choose between cmd.exe or powershell.exe.

Name

The Name of the executable chosen in the above option.

Window Style

The Window Style option allows you to choose from the below options available.

  • Hidden
  • Maximized
  • Minimized
  • Normal
Execution Mode

The Execution Mode can be chosen between the below two.

  • Synchronous - Wait for process to finish or timeout
  • Asynchronous - Leave process running
Working Directory

The Working Directory can be chosen by clicking on the ellipsis.

Timeout

The Timeout Settings can be chosen.

Arguments/Script

This space allows to specify the Argument/Script for the windows command or powershell. You could also insert variables or parameters as required by clicking on the button provided as an option. This helps in dynamically assigning parameters or the command.

Standard Input

You could specify the Standard inputs for the windows command or powershell. You could also insert variables or parameters as required by clicking on the button provided as an option. This helps in dynamically assigning parameters or the command.

Environment Variables

Add or remove Environment variables and its corresponding values.

Outputs Page

The Output page of the Windows Command Task shows you the available output settings.

Windows Command Task - Output.png

Exist Code Variables

The variable for writing the exit code can be chosen here.

Standard Output Variable

The variable for writing the standard output can be chosen here.

Error Output Variable

The variable for writing the Error output can be chosen here.

Process Id Variable

The variable for writing the Process Id can be chosen here.

Fail If Executable Not Found

Enable to fail if the executable is not found on the machine or server.

Fail If Timeout Exceeded

Enable to fail if the timeout exceeded.

Fail If Not Success Code

Enable to fail if there is no success code.