Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
Last active March 14, 2024 13:29
Show Gist options
  • Save magnetikonline/2217fd95cf15a0324696 to your computer and use it in GitHub Desktop.
Save magnetikonline/2217fd95cf15a0324696 to your computer and use it in GitHub Desktop.
NSSM - the Non-Sucking Service Manager cheatsheet.

NSSM cheatsheat

See: NSSM - the Non-Sucking Service Manager

Create a new service

nssm.exe install SERVICE_NAME "C:\path\to\exe\or\bat\file.ext" "argument1 argument2"

List parameters for a service

nssm.exe get SERVICE_NAME *

Set a parameter for a service

nssm.exe set SERVICE_NAME PARAMETER_NAME PARAMETER_VALUE
nssm.exe set SERVICE_NAME Description "My service description."
nssm.exe set SERVICE_NAME Start SERVICE_AUTO_START
nssm.exe set SERVICE_NAME AppExit Default Exit
nssm.exe set SERVICE_NAME AppStdout "C:\log\service-output.log"

Parameter list

AppAffinity
AppDirectory
AppEnvironment
AppEnvironmentExtra
AppExit
Application
AppNoConsole
AppParameters
AppPriority
AppRestartDelay
AppRotateBytes
AppRotateBytesHigh
AppRotateFiles
AppRotateOnline
AppRotateSeconds
AppStderr
AppStderrCreationDisposition
AppStderrFlagsAndAttributes
AppStderrShareMode
AppStdin
AppStdinCreationDisposition
AppStdinFlagsAndAttributes
AppStdinShareMode
AppStdout
AppStdoutCreationDisposition
AppStdoutFlagsAndAttributes
AppStdoutShareMode
AppStopMethodConsole
AppStopMethodSkip
AppStopMethodThreads
AppStopMethodWindow
AppThrottle
DependOnGroup
DependOnService
Description
DisplayName
ImagePath
Name
ObjectName
Start
Type
@moeshin
Copy link

moeshin commented Jan 22, 2022

How to fix program not executing at fast startup (fast boot)?
It's normal to restart windows. But shutdown and then on, the program will not be executed.

@gonbaum
Copy link

gonbaum commented Dec 30, 2022

My node app running through nssm is restarting, again and again, every ~20 secs, but not showing any error. Any idea of which could be the cause? I'm running nssm start <service> through a cmd script in a cmd prompt with administrator rights.

@alexqfredrickson
Copy link

I would like to silently install a service for WildFly in a single command and include the user and password to run the service.

This is what I have so far:

nssm install Wildfly15 D:\wildfly-15.0.1.Final\bin\standalone.bat "-b=127.0.0.1 --debug"

This is OK. It opens the dialog box. Can nssm me used silently and can you add logon username and password?

Not sure, but you can silently remove services. nssm remove <servicename> confirm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment