Windows Service Wrapper:将程序注册为windows系统服务工具
前言
- 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系统服务工具相关推荐
- 使用wrapper将java程序注册程windows服务后不生效
使用wrapper将java程序注册程windows服务后不生效 使用add.bat或test***.bat测试通过了, 然后使用install***.bat注册后cmd显示注册成功. 但是程序到了运 ...
- 通过jsl工具将java程序注册为windows服务
通过jsl工具将java程序注册为windows服务 首先下载jsl工具包,主要有jsl.exe可执行文件和jsl.ini配置信息文件 jsl 下载地址 在应用目录下新建以下几个路径 lib目录内容如 ...
- 怎样把任意exe程序注册成windows系统服务(手动注册服务)
怎样把任意exe程序注册成windows系统服务(手动注册服务) 1. 要实现这个功能要用到微软提供的两个小工具"instsrv.exe"和"srvany.exe&quo ...
- 潇洒郎: Python exe程序注册为windows 系统服务
1. 将python脚本生成exe文件 安装打包工具: pip install pyinstaller 生成exe文件: pyinstaller -F dial.py 如果想noconsole 则加参 ...
- windows第一个窗口程序转自windows程序设计王艳平老师编著
转 目录: 1.窗口程序 2.分析 注册窗口类别 建立窗口 显示窗口 消息循环 窗口消息处理程序 3.注意事项 窗口程 ...
- python exe程序注册为window系统服务
1.使用pyinstaller将py打包成exe 1.安装 pip install pyinstaller 2.打包成exe可执行文件 pyinstaller -F packTest.py #pack ...
- 怎样把任意exe程序注册成windows系统服务
方法一:使用windows自带的命令InstallUtil.exe 步骤:1.运行--〉cmd:打开cmd命令框2.在命令行里定位到InstallUtil.exe所在的位置InstallUtil.ex ...
- C#windows service效劳装置、注册、判别效劳能否存在、能否发动
2019独角兽企业重金招聘Python工程师标准>>> #region Windows效劳控制区#region 装置效劳private void InstallService(IDi ...
- C#控制台程序注册成Windows服务
在控制台程序中新增项目-->"Windows服务" 修改名称,我这里叫"Test_WindowsService" 然后在新增的"Windows服 ...
最新文章
- 【puthon】把大量csv文件写入h5文件制作数据集
- 关于使用scrapy框架编写爬虫以及Ajax动态加载问题、反爬问题解决方案
- js修改display_Vue.js从零开始——过渡 / 动画效果(2)
- OpenSSL(加密方式,加密算法,自签证书)
- 剑指offer之求二叉树中两个节点的最低共同父节点
- 【Python】Matplotlib绘制三维线形图
- 郭宏志的android无线点餐系统,Android无线点餐系统--含代码.doc
- mybatis中xml文件的#{param1}和#{属性名},比如#{id}的使用环境以及使用的时机情况
- JavaScript快速入门(一)——JavaScript概览
- 【CSS标签的嵌套规则】
- SPSS操作(五):主成分分析
- 最全汇总GAN网络及其各种变体(附论文及代码实现)
- Linux link命令
- 办理物联网卡不实名会有什么后果呢
- 如何破解禁止复制黏贴
- 达梦数据库——DM8安装操作及体系架构介绍
- 从国企到阿里的面试经历(一)
- 考研复试面试专业问题
- 如何写新产品开发报告书
- 人工智能可预测阿茨海默症病情演变