winsw(Windows Service Wrapper)是一个开源项目,它可以让我们把任意一个可执行的程序注册为Windows的系统服务。
下载地址:github/kohsuke/winsw/releases,如图:
下载对应平台的.exe(2和4)和配置文件
把下载的.exe文件重命名为你自己要用的服务名称,如**.exe
在**.exe同目录下创建xml配置文件命名为**.xml,可以复制上面下载的xml,简单配置如下:
配置规范(github/kohsuke/winsw/blob/master/doc/xmlConfigFile.md)
<configuration>
<!-- ID of the service. It should be unique accross the Windows system-->
<id>mitmwebServer</id>
<!-- Display name of the service -->
<name>MitmWeb</name>
<!-- Service description -->
<description>mitmproxy for windows server </description>
<!-- Path to the executable, which should be started -->
<executable>D:ProgramDataAnaconda3</executable>
</configuration>
**注意**:下载*.exe文件和*.xml文件后应将二者命名为同一个名字并放在同一目录下,并且使用管理员模式的shell进行以下命令的操作。注意保存这两个文件,每次服务启动时都会用到。
就像这样
注册服务
install
卸载服务
uninstall
如果卸载失败可以使用此命令:
sc delete MitmWeb
启动服务
start
关闭服务
stop
重启服务
restart
查看状态
status
本文发布于:2025-04-03 14:45:00,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/1743662758583650.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |