Run Command

The Run Command task can be used to execute specific command line instructions on the client. The administrator can specify the command line input to run.

important

Important

Commands are executed without access to a desktop environment. As a result, the execution of commands with requirements to the application's GUI may fail.

You can use ecmd commands with the Run Command task. For more information, visit the following Knowledgebase article.

Operating System

Command will run as user

Default working directory

Accessible network locations

Command will be run in

Windows

Local System

C:\Windows\Temp

Only locations in the current domain and available to user Local System

Command prompt (cmd.exe)

Linux or macOS

root

/tmp

Only if location is mounted and available to root user

Console

Basic

In the Basic section, enter basic information about the task, such as a Name and Description (optional). Click Select tags to assign tags.
In the Task drop-down menu, select the task type you want to create and configure. If you have selected a specific task type before creating a new task, Task is pre-selected based on your previous choice. Task (see the list of all Tasks) defines the settings and the behavior for the task.

Settings

Command line to run - Enter a command line you want to run on the client(s).

Working directory - Enter a directory where the command line above will be executed.

important

Important

Maximum command length restrictions:

Web Console can process up to 32,768 characters. If you copy-paste a longer command, it would silently cut off the end.

Linux and Mac are able to process the full length of the command. Windows has restriction for maximum 8,191 characters (read more here).

example

Example

To run a local script located on a client at C:\Users\user\script.bat follow these steps:

1.Create a new Client Task and select Run Command.

2.In the Settings section enter:

Command line to run: script.bat
Working Directory: C:\Users\user

3.Click Finish, create a trigger and choose target clients.

Summary

Review the summary of configured settings and click Finish. The Client Task is now created and a pop-up window will open. We recommend that you click Create Trigger to specify when this Client Task should be executed and on what Targets. If you click Close, you can create a Trigger later. To create a trigger afterward, select the Client Task instance and select Run on from the drop-down menu.

client_task_finish