实验环境:windows server2008R2 、windows10
一、下载winws.exe和winws.xml
下载地址:https://github.com/kohsuke/winsw/releases
下载红色处:

在这里插入图片描述
把exe文件、xml文件以及要打包成服务的jar包使用同名,方便管理

在这里插入图片描述
二、编辑auth-admin配置文件:

<configuration>  
  <!-- ID of the service. It should be unique accross the Windows system-->
  <id>auth-admin</id>
  <!-- Display name of the service -->
  <name>auth-admin</name>
  <!-- Service description -->
  <description>统一支撑平台</description>
  <executable>java</executable>
  <arguments>-jar auth-admin.jar</arguments>
</configuration>

三、cmd命令行进入当前目录
打包成服务:

auth-admin.exe install

卸载服务:

auth-admin.exe uninstall

启动服务:

 auth-admin.exe start

关闭服务:

 auth-admin.exe stop

重启服务:

auth-admin.exe restart 

查看状态:

 auth-admin.exe status

脚本启动:

cd C:\Users\Administrator\Desktop\service\auth-admin
auth-admin.exe  stop
auth-admin.exe  uninstall
auth-admin.exe  install
auth-admin.exe  start
Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐