前言

  • wsw 2.3.0

Windows Service Wrapper

WinSW is an executable binary, which can be used to wrap and manage a custom process as a Windows service. Once you download the installation package, you can rename winsw.exe to any name, e.g. myService.exe.

Windows Service Wrapper 可以将 exe应用、Java 的 jar 包等注册为 windows 服务。

项目地址:
https://github.com/kohsuke/winsw

下载 wsw 2.3.0

github上的下载地址:
https://github.com/kohsuke/winsw/releases/tag/winsw-v2.3.0

连不上github可以试试这个下载地址:
http://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/2.3.0/

下载WinSW.NET4.exe 和 sample-minimal.xml:
https://github.com/kohsuke/winsw/releases/download/winsw-v2.3.0/WinSW.NET4.exe
https://github.com/kohsuke/winsw/releases/download/winsw-v2.3.0/sample-minimal.xml

配置

以MyApp.exe的配置为例进行说明。
把WinSW.NET4.exe和exe可执行程序在同一个目录下。并将WinSW.NET4.exe更改名称,一般与exe可执行程序名一致。例如,将WinSW.NET4.exe改为MyApp_service.exe。
把sample-minimal.xml改名为MyApp_service.xml。

更改 MyApp_service.xml 配置文件为下面这样:

<configuration><!-- ID of the service. It should be unique across the Windows system--><id>MyApp</id><!-- Display name of the service --><name>MyApp</name><!-- Service description --><description>MyAppService (powered by WinSW)</description><!-- Path to the executable, which should be started --><executable>D:\MyApp\MyApp.exe</executable></configuration>

注册/卸载服务

以管理员身份运行 CMD 命令窗口,输入命令注册为 windows 服务

MyApp_service.exe install        # 注册服务
MyApp_service.exe uninstall     # 卸载服务

启动/停止服务

在 CMD 命令窗口,输入命令启动服务,或我的电脑右键管理,在服务列表中启动服务。

MyApp_service.exe start     # 启动服务
MyApp_service.exe stop      # 停止服务
MyApp_service.exe restart   # 重启服务
MyApp_service.exe status    # 查看服务运行状态

另一组可以启动/停止服务的命令

net start MyApp     # 启动服务
net stop  MyApp     # 停止服务
net stop MyApp && net start MyApp  # 重启服务

Windows Service Wrapper:将程序注册为windows系统服务工具相关推荐

  1. 使用wrapper将java程序注册程windows服务后不生效

    使用wrapper将java程序注册程windows服务后不生效 使用add.bat或test***.bat测试通过了, 然后使用install***.bat注册后cmd显示注册成功. 但是程序到了运 ...

  2. 通过jsl工具将java程序注册为windows服务

    通过jsl工具将java程序注册为windows服务 首先下载jsl工具包,主要有jsl.exe可执行文件和jsl.ini配置信息文件 jsl 下载地址 在应用目录下新建以下几个路径 lib目录内容如 ...

  3. 怎样把任意exe程序注册成windows系统服务(手动注册服务)

    怎样把任意exe程序注册成windows系统服务(手动注册服务) 1. 要实现这个功能要用到微软提供的两个小工具"instsrv.exe"和"srvany.exe&quo ...

  4. 潇洒郎: Python exe程序注册为windows 系统服务

    1. 将python脚本生成exe文件 安装打包工具: pip install pyinstaller 生成exe文件: pyinstaller -F dial.py 如果想noconsole 则加参 ...

  5. windows第一个窗口程序转自windows程序设计王艳平老师编著

    转 目录:   1.窗口程序  2.分析        注册窗口类别        建立窗口        显示窗口        消息循环        窗口消息处理程序    3.注意事项 窗口程 ...

  6. python exe程序注册为window系统服务

    1.使用pyinstaller将py打包成exe 1.安装 pip install pyinstaller 2.打包成exe可执行文件 pyinstaller -F packTest.py #pack ...

  7. 怎样把任意exe程序注册成windows系统服务

    方法一:使用windows自带的命令InstallUtil.exe 步骤:1.运行--〉cmd:打开cmd命令框2.在命令行里定位到InstallUtil.exe所在的位置InstallUtil.ex ...

  8. C#windows service效劳装置、注册、判别效劳能否存在、能否发动

    2019独角兽企业重金招聘Python工程师标准>>> #region Windows效劳控制区#region 装置效劳private void InstallService(IDi ...

  9. C#控制台程序注册成Windows服务

    在控制台程序中新增项目-->"Windows服务" 修改名称,我这里叫"Test_WindowsService" 然后在新增的"Windows服 ...

最新文章

  1. 【puthon】把大量csv文件写入h5文件制作数据集
  2. 关于使用scrapy框架编写爬虫以及Ajax动态加载问题、反爬问题解决方案
  3. js修改display_Vue.js从零开始——过渡 / 动画效果(2)
  4. OpenSSL(加密方式,加密算法,自签证书)
  5. 剑指offer之求二叉树中两个节点的最低共同父节点
  6. 【Python】Matplotlib绘制三维线形图
  7. 郭宏志的android无线点餐系统,Android无线点餐系统--含代码.doc
  8. mybatis中xml文件的#{param1}和#{属性名},比如#{id}的使用环境以及使用的时机情况
  9. JavaScript快速入门(一)——JavaScript概览
  10. 【CSS标签的嵌套规则】
  11. SPSS操作(五):主成分分析
  12. 最全汇总GAN网络及其各种变体(附论文及代码实现)
  13. Linux link命令
  14. 办理物联网卡不实名会有什么后果呢
  15. 如何破解禁止复制黏贴
  16. 达梦数据库——DM8安装操作及体系架构介绍
  17. 从国企到阿里的面试经历(一)
  18. 考研复试面试专业问题
  19. 如何写新产品开发报告书
  20. 人工智能可预测阿茨海默症病情演变

热门文章

  1. 又到中元节 应用宝教你如何打败各种鬼
  2. Matlab 图像的邻域和块操作
  3. 选项卡示例代码###
  4. NetBeans 时事通讯(刊号 # 60 - Jun 21, 2009)
  5. python分布式进程(windows下)
  6. Winform 打包 混淆 自动更新
  7. SpringBoot基础重难点
  8. Python+Django+Nginx+Uwsgi(史上最全步骤)(亲测)
  9. java类方法不可见_使java方法仅对特定类可见
  10. antd 设置表头属性_纯css实现固定表头和锁定列