/
Windows Service management

Windows Service management

To run a batch file or program as a service, you need an intermediate tool.

NSSM - the Non-Sucking Service Manager does all you need for your services. It’s free and open source. There exists a repository on Github with this name, but it is not managed by the author of the app. So, avoid it.

Install a service

nssm.exe install "service-name" , which will open a GUI to configure the service.

Later, you can edit the service by using: nssm.exe edit "service-name" .

To see list of services on a Windows machine, the official tool is services.msc . Nssm is convenient because you can manage any service from the machine.

Configure a service

Select which file you want to run, from where, and optional arguments.

Service restart

Nssm can automatically restarts a finished (or crashed) service. This is the default setting.

I/O redirection

Nssm can log output of your service in a given file. It’s convenient to debug issues.

User credentials

By default, your service runs on local SYSTEM account. If you need administrator access, simply create a user with those rights, and then use this account to run service:

 

Related content

How to setup LLVM buildbots for Windows 11 on Arm
How to setup LLVM buildbots for Windows 11 on Arm
Read with this
Services and Servers That Systems Manages
Services and Servers That Systems Manages
More like this
How to setup LLVM buildbots for Windows on Arm
How to setup LLVM buildbots for Windows on Arm
Read with this
How to setup WoA machine for python buildbot
How to setup WoA machine for python buildbot
More like this
WindowsPerf GUI Design Document [draft]
WindowsPerf GUI Design Document [draft]
More like this