目录
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,然后右键,点击 “启动” 即可。
Привет, друзья!
Купить документ ВУЗа можно у нас в столице.
ast-diplom24.ru/kupit-diplom-rostov-na-donu
Хорошей учебы!
Добрый день!
Где купить диплом по необходимой специальности?
usame.life/read-blog/46080
Добрый день!
Приобрести диплом о высшем образовании.
alex-neil.ru/index.php/cb-profile/pluginclass/cbblogs?action=blogs&func=show&id=233
Привет, друзья!
Быстрая схема покупки диплома старого образца: что важно знать?
landik-diploms-srednee.ru/attestat-shkoly В
You have made some good points there. I looked on the web to learn more about the issue and found most people will go along with your views on this site.
Привет, друзья!
Купить документ института
asxdiplomik.com/kupit-diplom-magistra
Добрый день!
Купить документ института можно в нашем сервисе.
diplomyx.com/kupit-diplom-omsk
Удачи!
buy paxlovid online: paxlovid covid – paxlovid covid
This website was… how do you say it? Relevant!! Finally I’ve found something which helped me. Thank you!
The next time I read a blog, I hope that it does not fail me just as much as this one. After all, I know it was my choice to read through, nonetheless I truly believed you would have something useful to say. All I hear is a bunch of complaining about something you could possibly fix if you weren’t too busy looking for attention.
Привет, друзья!
Купить диплом о высшем образовании.
gotartwork.com/Blog/mira-intensamente-2-2024-pelicula-online-en-espanol-y-latino/289921/
Хорошей учебы!
Как купить диплом о высшем образовании с минимальными рисками
diplomyx.com/kupit-diplom-rostov-na-donu
Здравствуйте!
Мы изготавливаем дипломы любых профессий по выгодным тарифам.
sportraketka.ru/vash-diplom-kachestvo-i-autentichnost
paxlovid covid: paxlovid covid – paxlovid pharmacy
Indibet is a premier online casino offering a wide array of games including slots, table games, and live dealer options. Renowned for its user-friendly interface and robust security measures, Indibet ensures a top-notch gaming experience with exciting bonuses and 24/7 customer support.
квартиры с отделкой от застройщика https://kvartiru-kupit43.ru
купить новую квартиру застройщик https://kvartira-new43.ru
купить 1 комнатную новостройку купить квартиру
Добрый день!
Где приобрести диплом специалиста?
http://www.marqueze.net/miembros/matthewmorgan/profile/classic/
buy cipro online usa: ciprofloxacin mail online – ciprofloxacin generic price
The future football star Shabab Al-Ahly https://dubai.shabab-al-ahli-ar.com was born in Dubai in 2000. From a young age, he showed exceptional football abilities and joined the youth academy of one of the UAE’s leading clubs, Shabab Al-Ahly.
Привет!
Мы изготавливаем дипломы любых профессий по приятным ценам.
cimat.com.do/купить-дипломы-гознак/
In the world of football, Atletico Madrid https://spain.atletico-madrid-ar.com has long been considered the second most important club in Spain after the dominant, Real Madrid.
The fascinating story of Ja Morant’s https://spain.atletico-madrid-ar.com meteoric rise, from status from rookie to leader of the Memphis Grizzlies and rising NBA superstar.
Galatasaray https://turkey.galatasaray-ar.com is one of the most famous football clubs in Turkiye, with a glorious and eventful history.
Good site you have here.. It’s difficult to find excellent writing like yours nowadays. I truly appreciate individuals like you! Take care!!
Привет, друзья!
Мы можем предложить дипломы любой профессии.
allukrnews.ru/ofitsialnyie-diplomyi-legalno-i-konfidentsialno/
Поможем вам всегда!.
Привет, друзья!
Купить диплом ВУЗа.
int.5bb.ru/viewtopic.php?id=23081#p91140
Успехов в учебе!
generic amoxicillin cost: purchase amoxicillin 500 mg – generic for amoxicillin
amoxicillin 500 mg: buy amoxicillin online mexico – purchase amoxicillin online without prescription
purchase cipro: buy cipro no rx – п»їcipro generic
Добрый день!
Заказать диплом ВУЗа.
xn--80ajjabicd1cty1a4fvb.xn--p1ai/blogs/1/bolshoy-assortiment-dokumentov-v-znamenitom-internetmagazine.php
AC Milan https://italy.milan-ar.com is one of the most successful and decorated football clubs in the world.
Ремонт плоской кровли https://remontiruem-krovly.ru в Москве, цена работы за 1 м?. Прайс лист на работы под ключ, отзывы и фото.
Thai Company Directory https://thaicorporates.com List of companies and business information.
Привет, друзья!
Купить документ института можно у нас в столице.
ast-diplom24.ru/kupit-diplom-vracha
Успешной учебы!
casino
Привет, друзья!
Купить диплом ВУЗа.
es-presto.ru/community/groups/0-0/176-ogromnyj-vybor-dokumentov-v-znamenitom-onlajn-magazine
Добрый день!
Купить документ о получении высшего образования можно в нашей компании.
diplomasx.com/kupit-diplom-tehnikuma-kolledzha
http://clomiddelivery.pro/# how to get cheap clomid without rx
paxlovid covid: paxlovid pharmacy – paxlovid buy
Добрый день!
Приобрести документ университета можно у нас в столице.
ast-diploms.com/kupit-diplom-krasnoyarsk
Удачи!
https://amoxildelivery.pro/# amoxicillin 500mg price
Real Madrid’s https://spain.real-madrid-ar.com history goes back more than a century. The club was founded in 1902 by a group of football enthusiasts led by Juan Padilla
Arsenal https://england.arsenal-ar.com is one of the most famous and successful football clubs in the history of English football.
Добрый день!
Приобрести документ ВУЗа можно у нас.
ast-diploms.com/kupit-diplom-novosibirsk
FC Bayern Munich (Munich) https://germany.bayern-munchen-ar.com is one of the most famous and recognized football clubs in Germany and Europe
http://amoxildelivery.pro/# buy amoxicillin 500mg canada
https://doxycyclinedelivery.pro/# where to purchase doxycycline
sailing Montenegro Montenegro rent boat