0
点赞
收藏
分享

微信扫一扫

windows设置自启动服务使用winsw


原理:使用winsw将shell命令包成服务并设置开机自启动
winsw github地址:https://github.com/winsw/winsw/releases/tag/v2.11.0
下载后将​​​winsw.exe​​​(​​WinSW-x64.exe ​​​重命名后的名称为​​winsw.exe​​​)放在和frp同级目录
新建xml文件命名为​​​winsw.xml​​,进行配置,如下:

<service>
<id>frpc</id>
<name>frpc</name>
<description>frpc服务</description>
<executable>frpc</executable>
<arguments>-c frpc.ini</arguments>
<logmode>reset</logmode>
</service>

文件结构如下图所示:

windows设置自启动服务使用winsw_运维

windows设置自启动服务使用winsw_运维_02


运行命令:

# 安装服务
winsw.exe install
# 卸载服务


举报

相关推荐

0 条评论