NSSM runs any application as a Windows Service and restarts it when it exits
unexpectedly — similar to srvany / cygrunsrv, but without the suck. It includes a
GUI installer and a full CLI.
This tree continues from upstream NSSM 2.24 (2014-08-31, public domain). The first modernized release is 2.25 (Visual Studio 2026 / MSVC v145, standardized layout).
Maintainer: Tuyn Doan
nssm/
├── README.md # this file
├── CHANGELOG.md # history + roadmap (Keep a Changelog)
├── build.cmd # Release build script (VS 2026 / v145)
├── pack.cmd # package win32+win64 into dist/nssm-<ver>.zip + SHA256
├── VERSION # version string (edit to bump; git tag overrides)
├── dist/ # packaged artifacts (git-ignored; publish via Releases)
├── nssm.sln # VS 2008 solution (reference until 2.26)
├── nssm.vcproj # VS 2008 project (reference until 2.26)
├── src/ # C++ sources grouped by responsibility
│ ├── include/ # umbrella header (nssm.h)
│ ├── cli/ # entry point & command dispatch (nssm.cpp)
│ ├── service/ # service host, process, hooks, accounts
│ ├── config/ # registry & settings mapping
│ ├── io/ # I/O redirect, rotation, event log
│ ├── gui/ # install/edit dialog (+ resource.h)
│ ├── platform/ # imports, utf8, env, console
│ ├── resources/ # nssm.rc, nssm.ico, messages.mc, version.cmd
│ └── gen/ # generated by build (git-ignored): messages.*, version.h
├── build/ # build output (git-ignored): build/tmp, build/out
└── docs/
├── manual.txt # full usage manual (upstream)
├── roadmap/ # interactive roadmap/backlog (index.html)
└── release/2.25/ # release notes for 2.25 (index.html)
Requires Visual Studio 2026 Build Tools with the Desktop development with C++
workload (toolset v145, MSVC 14.5x). Older installs (e.g. VS 2022 / v143) also work
via vswhere.
:: 32-bit (default)
build.cmd
:: 64-bit
build.cmd x64Output: build\out\x86\nssm.exe or build\out\x64\nssm.exe.
Quick check:
build\out\x86\nssm.exe versionThe version string comes from the VERSION file at the repo root (e.g. 2.25).
To change it, just edit that file and rebuild — no git required:
2.26
If git is available and the repo has tags, git describe --tags overrides the file
(so CI/tagged builds report the exact tag). Without git/tags, the VERSION file value is
used; if the file is missing too, it falls back to 0.0.
build.cmd locates Visual Studio via vswhere, loads the MSVC environment, generates
version.h (version.cmd), compiles messages.mc, nssm.rc, all *.cpp, and links
the required Windows libraries. Generated files (version.h, messages.h/.rc, *.bin)
are not committed (see .gitignore).
Sources are grouped into cli/, service/, config/, io/, gui/, and platform/;
the umbrella header lives in include/nssm.h. Build inputs are in resources/; generated
files go to src/gen/ (git-ignored). Legacy nssm.sln / nssm.vcproj sit at the repo
root (standard Visual Studio layout) and are reference-only until the 2.26 MSBuild migration.
Note: the project is still
nssm.vcproj(VS 2008 format) at the repo root, so MSBuild cannot build directly — usebuild.cmd. Migration tonssm.vcxprojis planned for 2.26 (see roadmap).
To produce a release archive, run:
pack.cmdThis builds both platforms (if needed) and writes dist\nssm-<version>.zip plus a
.sha256 checksum. The zip mirrors the upstream layout (nssm-<version>\win32\nssm.exe,
win64\nssm.exe, README.txt). dist/ is git-ignored — publish the archive via a
GitHub Release rather than committing binaries.
Full syntax is in docs/manual.txt. Quick examples:
nssm install <service> <application> [args]
nssm edit <service>
nssm start <service>
nssm stop <service>
nssm remove <service> confirmThe docs/ folder is published with GitHub Pages as a single-page hub at
https://tuyndoan.github.io/nssm/ — one page, four tabs (no page reloads):
- Overview — intro, quick start, navigation.
- Release — release notes rendered inline from
docs/release/<x.y.z>/release-data.js. - Roadmap — backlog/progress rendered inline from
docs/roadmap/roadmap-data.js. - Download — latest binaries pulled live from the GitHub Releases API (with a direct-link fallback).
Other references:
- Changelog:
CHANGELOG.md - Full manual:
docs/manual.txt· online - Standalone interactive pages remain at
docs/release/<x.y.z>/anddocs/roadmap/(also the source of the inline data).
To enable Pages: repo Settings → Pages → Source: GitHub Actions (the
pagesworkflow deploysdocs/on every push tomain).
NSSM is public domain. You may use it and/or its source code for any purpose. Original author: Iain Patterson and contributors (2003–2014).