ESET PROTECT On-Prem

Offline | Go online

ESET PROTECT On-Prem – Table of Contents

# Run Command

Copy current article URL Share via email

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.

|  | To enhance security and reduce the risk of unauthorized remote actions, access to the Run Command task is limited. You must enable Two-Factor Authentication (2FA) for the Run Command task to become available when creating a new task, or to run an existing Run Command task.

Select one of the following options to create a new Client Task:

•Click Tasks > Add > Client Task.

•Click Tasks > select the desired task type and click Add > Client Task.

•Click the target device in Computers and select Tasks > New Task.

|  | 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, type 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—Type a command line you want to run on the client(s).

•Working directory—Type a directory where the command line above will be executed. The Working directory is limited to 1,024 characters.

|  | You can type a multi-line command. Maximum command length restrictions: •Web Console can process up to 65,536 characters. If you copy-paste a longer command, it would silently cut off the end. •Linux and macOS can process the full length of the command. Windows has a restriction for maximum 8,191 characters.

|  | 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 type: •Command line to run: call script.bat •Working Directory: C:\Users\user 3.Click Finish, create a trigger and choose target clients. To run a multi-line command to restart a Windows service remotely (replace service_name with the service name, for example wuauserv for the Windows Update service): net stop service_name net start service_name

## Summary

Review the summary of configured settings and click Finish. The Client Task is now created, and a small window will open:

•Click Create Trigger (recommended) to specify Client Task Targets (computers or groups) and the Trigger.

•If you click Close, you can create a Trigger later—Click the Client Task and select Run on from the drop-down menu.

You can see the progress indicator bar, status icon and details for each created task in Tasks.

## Examine the Run Command task output

1.Click Tasks > click the task > Show Details > Executions tab > click a line in the table > History.

2.The Trace Message column contains the first 255 characters of the Run Command task output. You can create reports and process this data from several computers. You can download a bigger output as a Log Collector log in Computer Details > Logs > Log Collector.

˄˅