Skip to content

Instantly share code, notes, and snippets.

@linw1995
Created December 12, 2017 02:32
Show Gist options
  • Select an option

  • Save linw1995/e7577e3f31d715385d8c537985ee6a2f to your computer and use it in GitHub Desktop.

Select an option

Save linw1995/e7577e3f31d715385d8c537985ee6a2f to your computer and use it in GitHub Desktop.
NSSM exe转系统服务

NSSM exe转系统服务

使用过程(示例)

nssm install ServiceName ExecutePath [ExecuteParams]
nssm start ServiceName

找不到执行文件是不会保存的,运行服务时会失败

命令

安装服务

nssm install ServiceName ExecutePath [ExecuteParams]

移除服务

nssm remove ServiceName confirm

启动服务

nssm start ServiceName

停止服务

nssm stop ServiceName

重启服务

nssm restart ServiceName

服务传参

nssm set ServiceName AppParameters ExecuteParams

查看当前参数

nssm get ServiceName AppParameters

注意

  • 要保留执行文件
  • 示例使用的版本为 Version 2.24 64-bit, 2014-08-31(是当前最新版)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment