# Install Files.com Agent on Windows

To install the Files.com Agent on Windows, you will configure it to run as a Windows service. Running as a service starts the Agent automatically whenever the system powers on or reboots, and lets it recover from problems on its own. Installing the Agent as a service dramatically improves the reliability of your connection.

## Configure the Root Path

Verify that the `root` setting in the [configuration file](/connections/any-server-with-files.com-agent/agent-configuration-file.md) uses either a local drive path (for example, `C:\path\to\folder`) or a UNC path to an accessible network drive (for example, `\\servername\c$\path\to\folder`).

Microsoft advises using [UNC paths instead of mapped network drives for system services](https://learn.microsoft.com/en-us/windows/win32/services/services-and-redirected-drives) because mapped drives can cause security and reliability problems. Mapped drives are shared across accounts, so other services may gain unintended access.

## Set Service Account Permissions

The Windows service account running the Agent needs the right permissions to access the folder defined in the configuration file's `root` setting.

For most environments, a named Active Directory account is the best practice. Configure the service to log on as this account and verify that it exists on both the Agent host system and any remote system the UNC path references. This account must also have the "[Log on as a service](https://learn.microsoft.com/en-us/system-center/scsm/enable-service-log-on-sm)" privilege. The Agent can only access the `root` items that the selected user account has permissions to access. If you choose a local system user account instead, verify the same account exists and has appropriate access on both systems.

## MSI Based Service Installation <a href="#msi-based-service-installation" id="msi-based-service-installation"></a>

If you're using a Windows x86 64-bit system, download the Agent Installer MSI executable from the [Agent's download page](https://filescorp.hosted-by-files.com/builds/files-agent-server/latest).

Place the MSI file in the same folder as the Agent configuration file before installation. Once you've updated the [configuration file](/connections/any-server-with-files.com-agent/agent-configuration-file.md), run the MSI to install the Agent as a service.

After installation, you'll find the configuration file at `C:\Program Files\Files.com-Agent\files_agent_config.toml`.

## Command Line Service Installation <a href="#command-line-service-installation" id="command-line-service-installation"></a>

You can also install the Agent as a Windows service by using the command:

```
files-agent.exe service install --config C:\path\to\files_agent_config.toml
```

When you install the Agent this way, the executable and configuration file stay in their current locations. After installation, start the service from the command line by running:

```
files-agent.exe service start
```

If you need to update the configuration file, stop the service first, make your changes, and then restart the service.

To stop it via the command line, use:

```
files-agent.exe service stop
```

To remove the Agent service from the system, use the command:

```
files-agent.exe service uninstall
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://moverdocs.files.com/connections/any-server-with-files.com-agent/install-files.com-agent-on-windows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
