hmLoadTopic({
hmKeywords:"run command",
hmTitle:"Run Command",
hmDescription:"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.",
hmPrevLink:"client_tasks_rd_sensor_database_reset.html",
hmNextLink:"client_tasks_upgrade_components.html",
hmParentLink:"client_tasks.html",
hmBreadCrumbs:"<a href=\"using.html\">Using ESET PROTECT On-Prem<\/a> &gt; <a href=\"working_with_era.html\">ESET PROTECT On-Prem Main Menu<\/a> &gt; <a href=\"admin_ct.html\">Tasks<\/a> &gt; <a href=\"client_tasks.html\">Client Tasks<\/a>",
hmTitlePath:"Using ESET PROTECT On-Prem > ESET PROTECT On-Prem Main Menu > Tasks > Client Tasks > Run Command",
hmHeader:"<h1 class=\"p_Heading1\"><span class=\"f_Heading1\">Run Command<\/span><\/h1>\n\r",
hmBody:"<p class=\"p_Normal\">The <span class=\"f_UI\">Run Command<\/span> task can be used to execute specific command line instructions on the client. The administrator can specify the command line input to run.<\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 10px 0;\"><table class=\"Table_important\" >\n\r<tr class=\"Table_important\">\n\r<td class=\"Table_important\" style=\"width:4px; background-color:#E9A514;\"><br \/>\n\r<\/td>\n\r<td class=\"Table_important\" style=\"width:20px;\"><p class=\"p_Normal\"><img alt=\"Important\" title=\"Important\" width=\"20\" height=\"20\" style=\"margin:2px 0 0 0;width:20px;height:20px;border:none\" src=\".\/images\/important.svg\"\/><\/p>\n\r<\/td>\n\r<td class=\"Table_important\"><p class=\"p_Normal\">You must <a href=\"admin_ar_two_factor_authentification.html\" class=\"topiclink\">enable Two-Factor Authentication<\/a> (2FA) to run the command.<\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<p class=\"p_Normal\">Select one of the following options to create a new Client Task:<\/p>\n\r<p class=\"p_NormalList\" style=\"text-indent: 0; page-break-inside: avoid; page-break-after: avoid; padding-left: 13px; margin-left: 19px;\"><span class=\"f_NormalList\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span><span class=\"f_NormalList\">Click <\/span><span class=\"f_UI\">Tasks<\/span><span class=\"f_NormalList\"> &gt; <\/span><span class=\"f_UI\">Add<\/span><span class=\"f_NormalList\"> &gt; <img alt=\"Add\" title=\"Add\" width=\"16\" height=\"16\" style=\"margin:0;width:16px;height:16px;border:none\" src=\".\/images\/add_new_default.png\"\/><\/span><span class=\"f_UI\">Client Task<\/span><span class=\"f_NormalList\">.<\/span><\/p>\n\r<p class=\"p_NormalList\" style=\"text-indent: 0; page-break-inside: avoid; page-break-after: avoid; padding-left: 13px; margin-left: 19px;\"><span class=\"f_NormalList\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span><span class=\"f_NormalList\">Click <\/span><span class=\"f_UI\">Tasks<\/span><span class=\"f_NormalList\"> &gt; select the desired task type and click <\/span><span class=\"f_UI\">Add<\/span><span class=\"f_NormalList\"> &gt; <img alt=\"Add\" title=\"Add\" width=\"16\" height=\"16\" style=\"margin:0;width:16px;height:16px;border:none\" src=\".\/images\/add_new_default.png\"\/><\/span><span class=\"f_UI\">Client Task<\/span><span class=\"f_NormalList\">.<\/span><\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 32px; margin-left: 0;\"><span class=\"f_NormalList\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span>Click the target device in <span class=\"f_UI\">Computers<\/span> and select <img alt=\"Tasks\" title=\"Tasks\" width=\"16\" height=\"16\" style=\"margin:0;width:16px;height:16px;border:none\" src=\".\/images\/icon_tasks.png\"\/> <span class=\"f_UI\">Tasks<\/span> &gt; <img alt=\"Add\" title=\"Add\" width=\"16\" height=\"16\" style=\"margin:0;width:16px;height:16px;border:none\" src=\".\/images\/add_new_default.png\"\/><span class=\"f_UI\">New Task<\/span>.<\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 10px 0;\"><table class=\"Table_important\" >\n\r<tr class=\"Table_important\">\n\r<td class=\"Table_important\" style=\"width:4px; background-color:#E9A514;\"><br \/>\n\r<\/td>\n\r<td class=\"Table_important\" style=\"width:20px;\"><p class=\"p_Normal\"><img alt=\"Important\" title=\"Important\" width=\"20\" height=\"20\" style=\"margin:2px 0 0 0;width:20px;height:20px;border:none\" src=\".\/images\/important.svg\"\/><\/p>\n\r<\/td>\n\r<td class=\"Table_important\"><p class=\"p_Normal\">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.<\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<p class=\"p_Normal\">You can use <span class=\"f_CodeHighlighted\">ecmd<\/span> commands with the Run Command task. For more information, visit the following <a href=\"https:\/\/support.eset.com\/kb7277\/\" target=\"_blank\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">Knowledgebase article<\/a>.<\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 10px 0;\"><table class=\"Table_small\" style=\"width:100%;\">\n\r<thead>\n\r<tr class=\"Table_small\">\n\r<th class=\"Table_small\" style=\"width:146px;\" scope=\"col\"><p class=\"p_Head_row\"><span class=\"f_Head_row\">Operating System<\/span><\/p>\n\r<\/th>\n\r<th class=\"Table_small\" style=\"width:204px;\" scope=\"col\"><p class=\"p_Head_row\"><span class=\"f_Head_row\">Command will run as user<\/span><\/p>\n\r<\/th>\n\r<th class=\"Table_small\" style=\"width:216px;\" scope=\"col\"><p class=\"p_Head_row\"><span class=\"f_Head_row\">Default working directory<\/span><\/p>\n\r<\/th>\n\r<th class=\"Table_small\" style=\"width:439px;\" scope=\"col\"><p class=\"p_Head_row\"><span class=\"f_Head_row\">Accessible network locations<\/span><\/p>\n\r<\/th>\n\r<th class=\"Table_small\" style=\"width:266px;\" scope=\"col\"><p class=\"p_Head_row\"><span class=\"f_Head_row\">Command will be run in<\/span><\/p>\n\r<\/th>\n\r<\/tr>\n\r<\/thead>\n\r<tbody>\n\r<tr class=\"Table_small\">\n\r<td class=\"Table_small\" style=\"width:146px;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">Windows<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small\" style=\"width:204px;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_Path\">Local System<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small\" style=\"width:216px;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_Path\">C:\\Windows\\Temp<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small\" style=\"width:439px;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">Only locations in the current domain and available to user Local System<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small\" style=\"width:266px;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">Command prompt (<\/span><span class=\"f_CodeHighlighted\">cmd.exe<\/span><span class=\"f_NormalTable\">)<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr class=\"Table_small\">\n\r<td class=\"Table_small\" style=\"width:146px; background-color:#F4F5F4;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">Linux or macOS<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small\" style=\"width:204px; background-color:#F4F5F4;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_Path\">root<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small\" style=\"width:216px; background-color:#F4F5F4;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_Path\">\/tmp<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small\" style=\"width:439px; background-color:#F4F5F4;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">Only if location is mounted and available to root user<\/span><\/p>\n\r<\/td>\n\r<td class=\"Table_small\" style=\"width:266px; background-color:#F4F5F4;\"><p class=\"p_NormalTable\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_NormalTable\">Console<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/tbody>\n\r<\/table>\n\r<\/div>\n\r<h2 class=\"p_Heading2\" style=\"page-break-after: avoid;\"><span class=\"f_Heading2\">Basic<\/span><\/h2>\n\r<p class=\"p_Normal\">In the <span class=\"f_UI\">Basic<\/span> section, type basic information about the task, such as a <span class=\"f_UI\">Name and Description (optional)<\/span>. Click <span class=\"f_UI\">Select tags<\/span> to <a href=\"tags.html#assign_tags\" class=\"topiclink\">assign tags<\/a>.<br \/>\n\rIn the <span class=\"f_UI\">Task<\/span> 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, <span class=\"f_UI\">Task<\/span> is pre-selected based on your previous choice. <span class=\"f_UI\">Task<\/span> (see <a href=\"admin_ct.html\" class=\"topiclink\">the list of all Tasks<\/a>) defines the settings and the behavior for the task.<\/p>\n\r<h2 class=\"p_Heading2\" style=\"page-break-after: avoid;\"><span class=\"f_Heading2\">Settings<\/span><\/h2>\n\r<p class=\"p_NormalList\" style=\"text-indent: 0; page-break-inside: avoid; page-break-after: avoid; padding-left: 13px; margin-left: 19px;\"><span class=\"f_NormalList\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span><span class=\"f_UI\">Command line to run<\/span><span class=\"f_NormalList\">—Type a command line you want to run on the client(s).<\/span><\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 32px; margin-left: 0;\"><span class=\"f_NormalList\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span><span class=\"f_UI\">Working directory<\/span>—Type a directory where the command line above will be executed. The <span class=\"f_UI\">Working directory<\/span> is limited to 1,024 characters.<\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 10px 0;\"><table class=\"Table_important\" >\n\r<tr class=\"Table_important\">\n\r<td class=\"Table_important\" style=\"width:4px; background-color:#E9A514;\"><br \/>\n\r<\/td>\n\r<td class=\"Table_important\" style=\"width:20px;\"><p class=\"p_Normal\"><img alt=\"Important\" title=\"Important\" width=\"20\" height=\"20\" style=\"margin:2px 0 0 0;width:20px;height:20px;border:none\" src=\".\/images\/important.svg\"\/><\/p>\n\r<\/td>\n\r<td class=\"Table_important\"><p class=\"p_Normal\">You can type a multi-line command. Maximum command length restrictions:<\/p>\n\r<p class=\"p_NormalList\" style=\"text-indent: 0; page-break-inside: avoid; page-break-after: avoid; padding-left: 13px; margin-left: 19px;\"><span class=\"f_NormalList\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span><span class=\"f_NormalList\">Web Console can process up to 65,536 characters. If you copy-paste a longer command, it would silently cut off the end.<\/span><\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 32px; margin-left: 0;\"><span class=\"f_NormalList\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span>Linux and macOS can process the full length of the command. Windows has a <a href=\"https:\/\/docs.microsoft.com\/en-us\/troubleshoot\/windows-client\/shell-experience\/command-line-string-limitation\" target=\"_blank\" onclick=\"return HMTrackTopiclink(this);\" class=\"weblink\">restriction<\/a> for maximum 8,191 characters.<\/p><\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 0 10px 0;\"><table class=\"Table_example\" >\n\r<tr class=\"Table_example\">\n\r<td class=\"Table_example\" style=\"width:4px; background-color:#77BB1A;\"><br \/>\n\r<\/td>\n\r<td class=\"Table_example\" style=\"width:20px;\"><p class=\"p_Normal\"><img alt=\"Example\" title=\"Example\" width=\"20\" height=\"20\" style=\"margin:2px 0 0 0;width:20px;height:20px;border:none\" src=\".\/images\/example.svg\"\/><\/p>\n\r<\/td>\n\r<td class=\"Table_example\"><p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 13px; margin-left: 0;\"><span class=\"f_Normal\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span>To run a local script located on a client at <span class=\"f_Path\">C:\\Users\\user\\script.bat<\/span> follow these steps:<\/p>\n\r<p class=\"p_NormalList\" style=\"text-indent: 0; page-break-inside: avoid; page-break-after: avoid; padding-left: 20px; margin-left: 19px;\"><span class=\"f_NormalList\" style=\"display:inline-block;width:20px;margin-left:-20px\">1.<\/span><span class=\"f_NormalList\">Create a new Client Task and select <\/span><span class=\"f_UI\">Run Command<\/span><span class=\"f_NormalList\">.<\/span><\/p>\n\r<p class=\"p_NormalList\" style=\"text-indent: 0; page-break-inside: avoid; page-break-after: avoid; padding-left: 20px; margin-left: 19px;\"><span class=\"f_NormalList\" style=\"display:inline-block;width:20px;margin-left:-20px\">2.<\/span><span class=\"f_NormalList\">In the <\/span><span class=\"f_UI\">Settings<\/span><span class=\"f_NormalList\"> section type:<\/span><\/p>\n\r<p class=\"p_NormalList\" style=\"page-break-inside: avoid; page-break-after: avoid;\"><span class=\"f_UI\">Command line to run<\/span><span class=\"f_NormalList\">: <\/span><span class=\"f_CodeHighlighted\">call script.bat<\/span><br \/>\n\r<span class=\"f_UI\">Working Directory<\/span><span class=\"f_NormalList\">: <\/span><span class=\"f_Path\">C:\\Users\\user<\/span><\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 39px; margin-left: 0;\"><span class=\"f_NormalList\" style=\"display:inline-block;width:20px;margin-left:-20px\">3.<\/span>Click <span class=\"f_UI\">Finish<\/span>, create a trigger and choose target clients.<\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 13px; margin-left: 0;\"><span class=\"f_Normal\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span>To run a multi-line command to restart a Windows service remotely (replace <span class=\"f_CodeHighlighted\">service_name<\/span> with the service name, for example <span class=\"f_CodeHighlighted\">wuauserv<\/span> for the Windows Update service):<\/p>\n\r<p class=\"p_CodeHighlighted\" style=\"page-break-inside: avoid; margin: 0 0 0 13px;\"><span class=\"f_CodeHighlighted\">net&nbsp;stop&nbsp;service_name<\/span><\/p>\n\r<p class=\"p_CodeHighlighted\" style=\"page-break-inside: avoid; margin: 0 0 0 13px;\"><span class=\"f_CodeHighlighted\">net&nbsp;start&nbsp;service_name<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<h2 class=\"p_Heading2\" style=\"page-break-after: avoid;\"><span class=\"f_Heading2\">Summary<\/span><\/h2>\n\r<p class=\"p_Normal\">Review the summary of configured settings and click <span class=\"f_UI\">Finish<\/span>. The Client Task is now created, and a small window will open:<\/p>\n\r<p class=\"p_NormalList\" style=\"text-indent: 0; page-break-inside: avoid; page-break-after: avoid; padding-left: 13px; margin-left: 19px;\"><span class=\"f_NormalList\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span><span class=\"f_NormalList\">Click <a href=\"admin_ct_executions_trigger.html\" class=\"topiclink\">Create Trigger<\/a> (recommended) to specify Client Task Targets (computers or groups) and the Trigger.<\/span><\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 32px; margin-left: 0;\"><span class=\"f_NormalList\" style=\"font-family: Arial,\'Lucida Sans Unicode\',\'Lucida Grande\',\'Lucida Sans\';display:inline-block;width:13px;margin-left:-13px\">&#8226;<\/span>If you click <span class=\"f_UI\">Close<\/span>, you can create a <a href=\"admin_ct_executions_trigger.html\" class=\"topiclink\">Trigger<\/a> later—Click the Client Task and select <img alt=\"Run on\" title=\"Run on\" width=\"16\" height=\"16\" style=\"margin:0;width:16px;height:16px;border:none\" src=\".\/images\/restart_default.png\"\/> <span class=\"f_UI\">Run on<\/span> from the drop-down menu.<\/p>\n\r<p class=\"p_Normal\"><img alt=\"Create trigger.\" title=\"Create trigger.\" width=\"480\" height=\"155\" style=\"margin:0;width:480px;height:155px;border:none\" src=\".\/images\/client_task_finish.png\"\/><\/p>\n\r<p class=\"p_Normal\">You can see the <a href=\"admin_ct_executions_progress.html\" class=\"topiclink\">progress indicator bar<\/a>, <a href=\"admin_ct_executions_status_icon.html\" class=\"topiclink\">status icon<\/a> and <a href=\"admin_ct_executions_drill_down.html\" class=\"topiclink\">details<\/a> for each created task in <span class=\"f_UI\">Tasks<\/span>.<\/p>\n\r<h2 class=\"p_Heading2\" style=\"page-break-after: avoid;\"><span class=\"f_Heading2\">Examine the Run Command task output<\/span><\/h2>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 20px; margin-left: 0;\"><span class=\"f_Normal\" style=\"display:inline-block;width:20px;margin-left:-20px\">1.<\/span>Click <span class=\"f_UI\">Tasks<\/span> &gt; click the task &gt; <span class=\"f_UI\">Show Details<\/span> &gt; <span class=\"f_UI\">Executions<\/span> tab &gt; click a line in the table &gt; <img alt=\"History\" title=\"History\" width=\"16\" height=\"16\" style=\"margin:0;width:16px;height:16px;border:none\" src=\".\/images\/icon_history.png\"\/> <span class=\"f_UI\">History<\/span>.<\/p>\n\r<p class=\"p_Normal\" style=\"text-indent: 0; padding-left: 20px; margin-left: 0;\"><span class=\"f_Normal\" style=\"display:inline-block;width:20px;margin-left:-20px\">2.<\/span>The <span class=\"f_UI\">Trace Message<\/span> 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 <span class=\"f_UI\">Details<\/span> &gt; <span class=\"f_UI\">Logs<\/span> &gt; <a href=\"computer_details.html#logs\" class=\"topiclink\">Log Collector<\/a>.<\/p>"
})
