automation1002
automation1002

Reputation: 31

NSSM will not pickup executable directory

I'm trying to use the Non-Sucking Service Manager (NSSM) to create a service. Unfortunately, for whatever reason, NSSM won't play ball.

I'm trying to install the service using the following command:

nssm install "My Service" "C:\Program Files\Vendor\bin\windows\service-start.bat"

The service is successfully created. However, when I go to Services and Right-Click on "My Service" and view the properties the "Path to executable" field is set to the path of NSSM itself. In this case, 'C:\Program Files\nssm-2.24\win64\nssm.exe'.

I've attempted to change this using the following command:

nssm set "My Service" AppDirectory "C:\Program Files\Vendor\bin\windows\service-start.bat"

This doesn't make any difference and the executable path remains the same.

I'm trying to do this on Windows Server 2012 R2.

Upvotes: 3

Views: 7247

Answers (2)

Gambit
Gambit

Reputation: 223

As CodeCaster mentioned, the 'Path to Executable' is correctly referring to nssm. Since nssm is a wrapper, you technically tell nssm to manage your service.

If you want to verify if your installed service actually refers to your service, you will need to check that in nssm instead. You can do so with below command:

nssm edit <servicename>

Here you can see what is configured for your service and you can do some extra configuration here as well. I hope that clarifies things a bit.

Upvotes: 3

CodeCaster
CodeCaster

Reputation: 151674

NSSM is a wrapper which responds to SCM commands... which a batch file won't.

When registering the service, ...service-start.bat is configured as a commandline arguments to the NSSM executable.

Upvotes: 0

Related Questions