System Command

A System command task is used to run an executable, batch file or script file.

When running the controller service as a user account on Windows, the controller needs three Windows OS permission tokens to allow it to launch jobs as another user. See Specifying Controller Security Settings for information on assigning these permissions.
All of the fields described in this page are specific to this service. To get general information for setting up a task, see Tasks.

System Command Properties

This table describes the System Command task properties:

Field Description
Command

Executable, batch file or script file to run (command file). The task fails if the command file is not found.

We recommend that a fully qualified path be specified as part of the command. On Windows, If a fully qualified path is not specified, it will search for the command file to run in the following directories:

  • The directory from which the controller or agent application is loaded.
  • The current directory for the parent process.
  • The Windows system directory.
  • The Windows directory.
  • The directories listed in the System's PATH environment variable.
From the pop-up edit for this field, there is an option to specify that the command is a script to run. If specified, the command will become a multi-line edit in which the script can be specified. When run, the script will be saved to disk by the agent, executed, and then deleted from disk.
Parameters

Command line parameters to pass with the command.

Exit Codes A comma separated list of exit codes (the default is zero). The task will complete normal if it returns a value in this list, otherwise it will complete with an abnormal status.
Start Directory Directory to switch to before running the command file. This is similar to the Windows command "Start In."
The Start Directory is not used to find the command file.
Load Windows Profile

Load Windows Profile option to load the user profile into the Windows Registry for use by some kinds of utilities and applications (e.g., Windows utility CMDKEY).

Use Windows Interactive Session

Performs a LogonAsUser function to capture the environment variables defined for the users profile on the agent server.

If you receive the error “Logon failure: the user has not been granted the requested logon type at this computer” then the userid defined in the login does not have local login authority on the agent server, which is required.
Environment File Name of the file containing environment variables that will be used for this task.
Env Variables

Environmental variables to use for this task.

Agent and task related environment variables are set by the agent prior to running the task. See Environment Variables for System Command for more information.
Use Agent's Security Run the command file using the agent’s default security.
OS Login Becomes Active when Use Agent Security is unchecked. Click on the Search Icon to select an OS login.
See Creating a Process to add this task to a process.