美文网首页
Windows下使用winsw自定义自启动服务

Windows下使用winsw自定义自启动服务

作者: 皮多堡 | 来源:发表于2020-10-22 11:15 被阅读0次

windows上没有nohup run.sh & 一直开启cmd窗口,实在不方便,所以找到了WinSW工具

下载

下载地址


选择如下两个文件下载

配置

下载完成后,放在同一文件夹下,重命名为相同的名字,如下
编辑xml文件如下

<service>
  
  <!-- ID of the service. It should be unique across the Windows system-->
  <id>elasticsearch7</id>
  <!-- Display name of the service -->
  <name>elasticsearch7</name>
  <!-- Service description -->
  <description>This service is a service created from a minimal configuration</description>
  
  <!-- Path to the executable, which should be started -->
  <executable>D:\MyProgram\development\elk\elasticsearch-7.7.1\bin\elasticsearch.bat</executable>
  
   <!-- <arguments>-jar statement-0.0.1-SNAPSHOT.jar</arguments> -->

</service>
### 注册服务

当前文件夹下以管理员身份打开cmd,运行boot.exe install

启动服务并运行

提示成功后services.msc 打开服务列表,启动对用的服务,并设置为自启动即可

相关文章

网友评论

      本文标题:Windows下使用winsw自定义自启动服务

      本文链接:https://www.haomeiwen.com/subject/hfuumktx.html