目录
WinSW
* WinSW(Windows Service Wrapper)是一个开源项目,它可以让我们快速把一个可执行的程序注册为Windows的系统服务。
* 可以使得程序可以自启动,或者是可以关闭cmd窗口后保持运行。
环境
- Windows系统:Win11
- 系统自带的服务控制:services.msc
- -
- -
- 如果找不到的话可以通过运行窗口调用起来
- 首先按 win + r 调出运行窗口
- 然后输入 services.msc ,回车
- -
- WinSW
- 版本:v3.0.0
- github地址:https://github.com/winsw/winsw
使用方法
- 下载WinSW
- 复制 WinSW-x64.exe 到想要注册为服务的程序所在目录。
- 这里以注册nginx为例:
- 记住你下载的WinSW的名字,比如我的是WinSW.exe,那就新建一个同名的WinSW.xml.
- 当然你可以修改程序的名字,比如改为hello.exe,那就要新建一个同名的hello.xml.
- 直接在当前目录下右键新建文本文件
- -
- 写入如下内容
- 分析(仅说明需要修改的地方):
- 具体见相关外链:winsw配置文件参数解释说明 - 安夜的cookie
- <id>:指定Windows内部用户标识服务的id;在系统安装的所有服务中id必须是唯一的,并且完全由字母数字字符组成。
- <name>:服务的简短显示名称,可以包含空格和其他字符;在系统的所有服务中name也必须是唯一的。
- <description>:对服务的完整描述。
- <executable>:指定要启动的可执行文件,可以是绝对路径,也可以只指定可执行文件名称并从PATH中搜索。
- <startargument>启动时的传递参数
- <stopargument>停止时的传递参数
- 一般修改<id> <name> <description> 都写为服务名就可以了。
- <executable>写exe程序所在的路径,且路径尾部包含程序名
- <logpath>写exe程序所在路径即可
- <startargument>一般改成程序的路径,后面添加对应的程序启动的命令
- 比如frps一般的启动命令是frps -s frps.ini
- 这样的话这里就可以在路径后面增加 -s D:\frp\frps.ini
- 注意所有文件路径最好都用绝对路径
- <stopargument>一般改成程序路径,并且后面的-s stop改为对应的程序停止的命令
- 同<startargument>的写法。
<?xml version="1.0" encoding="UTF-8" ?>
<service>
<id>nginx</id>
<name>nginx</name>
<description>nginx</description>
<executable>D:\0Acoolight\App\nginx\nginx-1.20.2\nginx.exe</executable>
<logpath>D:\0Acoolight\App\nginx\nginx-1.20.2\</logpath>
<logmode>roll</logmode>
<depend></depend>
<startargument>-p D:\0Acoolight\App\nginx\nginx-1.20.2</startargument>
<stopargument>-p D:\0Acoolight\App\nginx\nginx-1.20.2 -s stop</stopargument>
</service>
- -
- 把文本文件另存为xml文件,如果不另存为的话,其后缀仍是txt
- 在当前目录下启动cmd。
- 安装服务,在cmd中输入以下命令并回车执行:
- WinSW-x64.exe install
- 至此,系统的服务管理中已经会有nginx这个服务了
- 调出服务管理的方法参见本文开头
调整服务为自启动
- 选中nginx服务项
- 右键,然后点击属性
- 如图,启动类型选择自动,并保存即可。
手动启动服务
- 如果服务没有启动,可以手动启动一下它
- 在服务管理中选中nginx,然后右键,点击 “启动” 即可。
https://mexicanpharm1st.com/# п»їbest mexican online pharmacies
reputable mexican pharmacies online: best online pharmacies in mexico – mexican pharmaceuticals online
medicine in mexico pharmacies mexico drug stores pharmacies medicine in mexico pharmacies
treat ed over the counter ed treatment over the counter erectile dysfunction pills
mexico drug stores pharmacies: medication from mexico pharmacy – mexican border pharmacies shipping to usa
buying from online mexican pharmacy: buying prescription drugs in mexico online – pharmacies in mexico that ship to usa
best online pharmacies in mexico: mexican mail order pharmacies – buying from online mexican pharmacy
medications list: generic ed pills – buy medication online
top 10 pharmacies in india: best online pharmacy india – п»їlegitimate online pharmacies india
http://indianpharm1st.com/# india pharmacy mail order
https://drugs1st.store/# erectile dysfunction medicines
cheap medication online drugs and medications anti fungal pills without prescription
please hurry Join to my site gangbang site guys
best male ed pills: ambien without a doctor’s prescription – best pills for ed
Временная регистрация в Москве: Быстро и Легально!
Ищете, где оформить временную регистрацию в Москве?
Мы гарантируем быстрое и легальное оформление без очередей и лишних документов.
Ваше спокойствие – наша забота!
Минимум усилий • Максимум удобства • Полная легальность
Свяжитесь с нами прямо сейчас!
Временная регистрация в Москве
top 10 pharmacies in india: buy prescription drugs from india – Online medicine order
purple pharmacy mexico price list: medicine in mexico pharmacies – mexico drug stores pharmacies
best ed pills non prescription best over the counter ed pills pet meds without vet prescription
https://indianpharm1st.com/# mail order pharmacy india
medication from mexico pharmacy medication from mexico pharmacy mexico drug stores pharmacies
п»їbest mexican online pharmacies: mexican rx online – mexican mail order pharmacies
http://mexicanpharm1st.com/# pharmacies in mexico that ship to usa
http://indianpharm1st.com/# п»їlegitimate online pharmacies india
Сервисный центр предлагает стоимость ремонта компьютера brandstar центр ремонта компьютера brandstar
mexican drugstore online: medicine in mexico pharmacies – mexican pharmaceuticals online
From start to finish, everything was perfect. Thank you for being so awesome and helpful!
online shopping pharmacy india: online pharmacy india – reputable indian online pharmacy
Easy accessibility and FREE parking.
Don’t be afraid to make use of bold colours in your bathroom design.
Among the best things about traveling is attempting all of the different foods all over the world, however what’s even better is attending to try all of the different desserts all over the world.
18 September 1978 – Bobby Finch, 30, who died of meningitis, performed six league games for QPR in the late 1960s before shifting to South Africa.
For soccer fans and learners, this printable soccer pool template in clean form will be of very a lot importance.
Glass House, Fulham. Artist Biographies.
Jackie Kennedy’s fashion recommendation to women was at all times to remove one thing from an outfit earlier than going out.
Vol. 68. London: Studio Vista, Cassell Ltd.
Beginning January 1, 2024, residence energy audits have to be carried out by a qualified Dwelling Power Auditor or under the supervision of a qualified Home Power Auditor.
The thought will not be for the butter board to be uniform when it comes to look or style, but to present an expertise that can change into as distinctive as every one who attracts from it.
Léopard sailed with 74 males from Mauritius on 26 November, and arrived at Saint-Denis on the twenty seventh.
The size of your pool pump cowl will must be larger to accommodate the increase in the scale of the tools needed to take care of your pool.
The pool heat pump is geared up solely with a titanium heat exchanger.
The programme and subsequent press coverage, together with Clarke’s look on the cowl of Vogue, photographed by Robert Mapplethorpe, introduced him to broader public consideration.
The cathedral also has an early Tree of Jessé window, illustrating the genealogy of Christ within the shape of a family tree imagined in a dream by the prophet Jesse.