Skip to content

Instantly share code, notes, and snippets.

@mh-cbon
Forked from magnetikonline/README.md
Last active June 28, 2023 13:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mh-cbon/bd0c860d42db33508d817e12fb540cdb to your computer and use it in GitHub Desktop.
Save mh-cbon/bd0c860d42db33508d817e12fb540cdb to your computer and use it in GitHub Desktop.
NSSM - the Non-Sucking Service Manager cheatsheet.

NSSM cheatsheat

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

START parameters

SERVICE_AUTO_START: Automatic startup at boot.
SERVICE_DELAYED_START: Delayed startup at boot.
SERVICE_DEMAND_START: Manual startup.
SERVICE_DISABLED: Service is disabled.
@lewisMachilika
Copy link

Thank you a lot

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