> For the complete documentation index, see [llms.txt](https://help.security.gallagher.com/knowledge-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.security.gallagher.com/knowledge-hub/command-centre-client/configuring-command-centre/administration/macros/adding-command-lines-for-macros.md).

# Adding Command Lines for Macros

### Introduction

A macro can be configured to execute a user-specified command line action at the Command Centre Server, when the macro is run, (e.g. emailing a person a specific message on receipt of an event in Command Centre, or running an application that closes down specific workstations). Multiple command line entries can be added to a single macro, and other items and actions that macros currently perform can also be added to the same macro.

This procedure allows you to add a command line to a macro.

**Notes:**

* The **Command Lines** property page does not display for a CAPSS site, (i.e. when `NPSA=1` appears in the licence file Features section). Command line macros cannot be run for such sites.
* You need to know a valid logon name and password for the Server PC to be able to run command lines.

### Procedure

1. Click on the Macro that you want to add Command Line(s) to, from the list in the Viewer Navigation Panel.

   The properties for that Macro populate the Viewer Panel.
2. Click the **Advanced** tab.

   ![](https://2455150842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi6UYAoyykM6nimMN9yss%2Fuploads%2Fgit-blob-faf468aebff0fce1ac47fc9093c5791bcdf852a1%2Fmacro_advancedtab.png?alt=media)
3. Click the **Add** button.

   A Command Line pop-up displays.

   ![](https://2455150842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi6UYAoyykM6nimMN9yss%2Fuploads%2Fgit-blob-66fb63c48f100db54e7a8b02ebbd7060a483d326%2Fmacros_commandlinepopup.png?alt=media)

   **Note:** There is no limit to the number of command lines that can be added to the Command Line grid.
4. Complete the fields as appropriate.

   <table><thead><tr><th width="132">Field</th><th>Description</th></tr></thead><tbody><tr><td>Command</td><td>Specify the executable or batch file to initiate when the macro is run.<br>The application or file specified does not have to be limited within Command Centre, (i.e. any file name or extension is acceptable).<br>The command line can, optionally, include up to 300 characters free text entry, used to specify the parameters associated with the file to be run from the command line. The free text entry can include ASCII characters, (e.g. #, % and /). These parameters, if configured, are passed to the command line, in addition to the file that is called when the macro is run.<br>(Maximum length = 300 characters)</td></tr><tr><td>Agruments</td><td>Specify the additional command line arguments that are passed to the executable.<br>(Maximum length = 300 characters)</td></tr></tbody></table>
5. Click the **OK** button.

   The pop-up closes.
6. Click the appropriate radio button for how you want the command lines to be executed.

   <table><thead><tr><th width="150">Field</th><th>Description</th></tr></thead><tbody><tr><td>Run only when user is logged on</td><td>This option will only run the command lines if you are actively logged into Windows when the macro executes. If a command line has a GUI component it will be visible.</td></tr><tr><td>Run whether user is logged on or not</td><td>This option runs the command lines regardless of whether you are logged into Windows, but all commands will be run in the background, (i.e. any GUI component in a command will not be visible).</td></tr></tbody></table>
7. Complete the Windows account fields as appropriate.

   <table><thead><tr><th width="132">Field</th><th>Description</th></tr></thead><tbody><tr><td>User Name</td><td>To configure a command line with a domain account, you must prefix the 'User Name' with the domain name plus a slash character, (e.g. Gallagher 1\FTUser).<br>(Maximum length = 280 characters)</td></tr><tr><td>Password and Confirm Password</td><td>The password for the Windows User Account must be typed in both the 'Password' and the 'Confirm Password' fields.<br>The password will not be made visible during configuration or when the macro properties are viewed.<br>(Maximum length = 260 characters)</td></tr></tbody></table>

   **Note:**

   A valid Logon name/password on the Server PC must have one of the following privileges under 'Local Security Settings':

   * Log on locally.

     This allows interactive access, and any program run from a macro (from another workstation) will show running actively on the server monitor.
   * Log on as a batch.

     This allows the program to execute in the background on the server (need to view through Task Manager).

     OR
   * NOT be "denied access from the network" as this will stop an executable running if the user doesn't also have the "log on locally" privilege
8. Click the **Save** button.

   A macro has been configured to execute a user-specified command line(s) when the macro is run.

   **Note:** When macros with command line(s) are run, problems may occur if there are 32 user accounts on the server that are used to run separate macros. This is due to a restriction in your operating system.

### Hints

{% hint style="info" %}
**Editing Command Lines**

Only one Command Line entry can be edited at once. Therefore, if none of the Command Line entries are selected, the **Edit** button will be disabled.

You must re-enter the account password to log onto the Server's operating system. If you do not re-enter the account password you will be prevented from saving any changes to the Command Line configuration.
{% endhint %}

{% hint style="info" %}
**Removing Command Lines**

Command Line entries can be removed by selecting the entry you want to remove and clicking the **Remove** button.
{% endhint %}

{% hint style="info" %}
**Local Policies**

If you are running 'FT Command Centre Service' as a specific user, apply that user to "Replace a process level token" (via **Control Panel** > **Administrative Tools** > **Local Security Policy** > **User Rights Assignment** ), to allow you to run all Macros that require local system or Network service privileges.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.security.gallagher.com/knowledge-hub/command-centre-client/configuring-command-centre/administration/macros/adding-command-lines-for-macros.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
