NSSM和WinSW把exe注册成服务,sc可以操作服务 sc query xx服务名字
NSSM下载地址:NSSM - the Non-Sucking Service Manager http://www.nssm.cc/release/nssm-2.24.zip
WinSW下载地址:Releases · winsw/winsw · GitHub
1、根据需要注册的系统,64系统使用WinSW-x64.exe或者32系统使用WinSW-x86.exe
2、复制WinSW-x64.exe或者WinSW-x86.exe到需要注册的目录,把名称修改为需要注册的名字(名字随意)
3、
例如:nginx.exe 需要注册到服务中(64系统使用WinSW-x64.exe)
1、修改WinSW-x64.exe为nginxService.exe
2、修改sample-minimal.xml为nginxService.xml(nginxService.exe与nginxService.xml必须同一目录)
3、nginxService.xml中内容如下
4、在nginxService.exe当前目录中进入cmd ,执行nginxService.exe install,服务中就有了
nginxService.xml中内容如下
nginxService123
nginxService
nginx服务的描述
nginx.exe
java注册666.jar注册到服务,有参数
例如:jar需要注册到服务中(64系统使用WinSW-x64.exe)
1、修改WinSW-x64.exe为javaService.exe
2、修改sample-minimal.xml为javaService.xml(java.exe与javaService.xml必须同一目录)
3、javaService.xml中内容如下
4、在javaService.exe当前目录中进入cmd ,执行javaService.exe install,服务中就有了
javaService.xml中内容如下
javaService123
javaService
jar服务的描述
java
-jar 666.jar