开机自启动相关程序

软件下载:https://github.com/kohsuke/winsw/releases

第一步:重命名WinSW.NET2.exe/WinSW.NET4.exe 为您所需要的.exe文件,主要是方便生成服务名称。

如:如果您的windows服务器开机需要启动nginx,则您可以命名为:nginx-service.exe

第二步:重命名配置文件,官网提供sample-allOptions.xml 和 sample-minimal.xml,重命名为:nginx-service.xml

第三步:修改xml文件,

<configuration>
 
<!-- ID of the service. It should be unique accross the Windows system-->
<id>nginx</id>
<!-- Display name of the service -->
<name>nginx service</name>
<!-- Service description -->
<description>High Performance Nginx Service</description>
 
<!-- Path to the executable, which should be started -->
<executable>D:\nginx-1.14.0\nginx.exe</executable>

</configuration>
 
第四步:通过cmd命令,安装服务 D:\nginx-1.14.0\nginx-service.exe install
第五步:启动服务

猜你喜欢

转载自www.cnblogs.com/eshinex/p/9900677.html