Run Command
Run Command runs the command line typed into it on the selected computers. With the agent, the command runs as the agent's service account: the local system account. The Script Library is not involved. The command needs no approval and has no seal.
Menu path
Endpoints > Endpoint List > select the computers > Connect > Run Command.

The dialog
The dialog is titled Run Command.
| Field | What it does | Default |
|---|---|---|
| Computer Names | The computers the command runs on | The selected rows |
| Command line | The command to run, as typed at a command prompt | Empty |
| Timeout seconds | How long the command may run before it is stopped | 15 |
| Detached | 1 starts the command in the background and returns at once. 0 waits for it to finish. | 0 |
Effect on the computer
The agent runs cmd.exe /c followed by the command line. With Detached at 1, it runs start /b cmd.exe /c followed by the command line.
| Outcome | Result |
|---|---|
| Exit code 0, 3010 or 1641 | Applied, with the command's output |
| Any other exit code | Failed, with the exit code and the command's output |
| Still running when Timeout seconds passes | The process is stopped. Failed with "Process did not exit within" and the number of seconds. |
A computer with no agent receives the command agentless, through the collection server and the stored credentials.
After you click OK
The message reads "Sent to the selected computers." and asks "Do you want to follow it now?". Yes opens Activity. The phases are Sent and Applied.
Undo
A command cannot be undone. A command line can do anything, so xAssets cannot compute its reverse.
Access control
Run Command gives its user any command on every computer they can select. On a computer with the agent, it runs as the local system account. Allow it only to the user groups that administer computers. Deny it to every other group in the menu security for the Run Command item. See Menu Security.
The approved route
Change > Software and Files > Run a Script runs a script only after the approvals set in the keyring. The agent checks the approval before it runs. Use Run a Script for any command that is run more than once, or by more than one person. See Run a Script.
Key points
- A command that waits for input never gets it. It runs until Timeout seconds passes and then fails.
- Raise Timeout seconds for slow commands, or set Detached to 1 and check the result later.
- A detached command reports success as soon as it starts. Its own failure is not reported.