# Сервер PassOffice как служба Windows

Для запуска серверного приложения PassOffice в фоновом режиме необходимо создать службу Windows, которая запустит процесс.

Для создания службы используйте бесплатную утилиту [NSSM](https://nssm.cc).

1. Скачать NSSM с [официального сайта](https://nssm.cc/download) производителя.
2. Распаковать архив в папку `C:\nssm`.
3. Открыть командную строку Windows, перейти в папку и запустить утилиту:

```powershell
cd "C:\nssm\win64"
.\nssm.exe install "PassOffice Server"
```

4. В появившемся окне на вкладке **Application** в поле **Path** укажите путь к `PassOfficeSrv.bat`

<figure><img src="/files/4pNv0E41krBGmorAUHCI" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
В поле **Arguments** вы можете указать параметр запуска `--mode=silent` для автоматического запуска миграции БД без ожидания ввода подверждения.
{% endhint %}

5. На вкладке **Dependencies** необходимо указать имя службы PostgreSQL для создания зависимости при запуске:

<figure><img src="/files/UwAQEuIWmVaeZ0pk4xmE" alt="" width="375"><figcaption></figcaption></figure>

5. Нажать кнопку **Install service** - готово! Теперь сервер PassOffice будет запускаться автоматически как Служба Windows.

<figure><img src="/files/UJ9VW0jZvIcahCZo48C2" alt="" width="375"><figcaption></figcaption></figure>


---

# 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://docs.aamsystems.ru/passoffice/passoffice-guide/admin-guide-doc/ustanovka-passoffice/sposoby-ustanovki/windows/server/server-passoffice-kak-sluzhba-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.
