目录
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,然后右键,点击 “启动” 即可。
After I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I receive four emails with the same comment. Perhaps there is a means you are able to remove me from that service? Cheers.
Привет!
Купить документ о получении высшего образования можно в нашей компании в Москве.
ast-diplom.com/kupit-diplom-kandidata-nauk
Здравствуйте!
Мы предлагаем дипломы любых профессий по приятным тарифам.
wutdawut.com/read-blog/2062_nadezhnyj-onlajn-magazin-s-ogromnym-katalogom-diplomov.html?mode=day
лучшее порево онлайн http://besplatny-sex-online.ru/ .
Здравствуйте!
Заказать документ о получении высшего образования вы можете в нашей компании в Москве.
diplomyx24.ru/kupit-diplom-nizhnij-novgorod
Удачи!
купить диплом в домодедово diploms-x.com .
Добрый день!
Мы готовы предложить дипломы любых профессий.
iladuanas.com/отзывы-о-купить-диплом/
Рады оказать помощь!.
п»їcipro generic: where to buy cipro online – buy cipro cheap
лучшее порно порево http://besplatny-sex-online.ru .
can you buy doxycycline over the counter nz: doxycycline nz cost – doxycycline 50 mg price
Jennifer Lopez https://lets-get-loud.jenniferlopez-ar.com was born in 1969 in the Bronx, New York, to parents who were Puerto Rican immigrants.
https://paxloviddelivery.pro/# Paxlovid buy online
Привет!
Приобрести документ о получении высшего образования можно в нашей компании в столице.
ast-diplom.com/kupit-diplom-chelyabinsk
порно занятие йогой порно занятие йогой .
You’ve made some really good points there. I checked on the web to learn more about the issue and found most individuals will go along with your views on this site.
Привет, друзья!
Купить диплом о высшем образовании
http://www.jointcorners.com/read-blog/78325
Привет, друзья!
Как получить диплом стоматолога быстро и официально
ashinova.ru/category-5/t-1525.html#1576
Рады помочь!.
When Taylor Swift https://shake-it-off.taylor-swift-ar.com released “Shake It Off” in 2014, she had no idea how much the song would impact her life and music career.
Привет!
Где заказать диплом по нужной специальности?
Заказать диплом ВУЗа.
158.160.31.233/blogs/1/kak-nayti-proverennyy-onlayn-magazin-s-ogromnym-katalogom-diplomov.php
http://paxloviddelivery.pro/# paxlovid generic
Priyanka Chopra https://baywatch.priyankachopra-ar.com is an Indian actress, singer, film producer and model who has achieved global success.
порно йога порно йога .
http://clomiddelivery.pro/# cost generic clomid no prescription
Привет, друзья!
Где заказать диплом по актуальной специальности?
irishpal.com/read-blog/921
Хорошей учебы!
Liverpool https://england.liverpool-ar.com holds a special place in the history of football in England.
https://amoxildelivery.pro/# buy amoxicillin 500mg usa
Автомобили Hongqi https://hongqi-krasnoyarsk.ru в наличии – официальный дилер Hongqi Красноярск
Здравствуйте!
Где заказать диплом по актуальной специальности?
Приобрести диплом любого университета.
158.160.31.233/blogs/1/kak-nayti-proverennyy-onlayn-magazin-s-ogromnym-katalogom-diplomov.php
Привет!
Мы предлагаем дипломы любой профессии по выгодным ценам.
bankendigital.de/дипломы-купить-в-кирове/
https://ciprodelivery.pro/# buy ciprofloxacin over the counter
Привет, друзья!
Мы готовы предложить документы ВУЗов, которые находятся на территории всей России. Можно купить качественно сделанный диплом от любого заведения, за любой год, указав актуальную специальность и оценки за все дисциплины. Документы печатаются на бумаге высшего качества. Это дает возможность делать настоящие дипломы, не отличимые от оригиналов. Документы будут заверены всеми требуемыми печатями и штампами.
webmentes.com/read-blog/200
doxycycline prescription canada: can i buy doxycycline over the counter in europe – can i buy doxycycline over the counter
https://clomiddelivery.pro/# can i get generic clomid without dr prescription
Привет!
Мы можем предложить документы ВУЗов, которые расположены на территории всей РФ. Можно заказать качественный диплом за любой год, указав актуальную специальность и хорошие оценки за все дисциплины. Документы выпускаются на “правильной” бумаге самого высокого качества. Это дает возможности делать настоящие дипломы, которые невозможно отличить от оригинала. Документы будут заверены необходимыми печатями и штампами.
1zvgk3zxu.blogpayz.com/28328296/%D0%9A%D0%B0%D0%BA-%D0%BC%D0%BE%D0%B6%D0%BD%D0%BE-%D0%BD%D0%B5%D0%B4%D0%BE%D1%80%D0%BE%D0%B3%D0%BE-%D0%BF%D1%80%D0%B8%D0%BE%D0%B1%D1%80%D0%B5%D1%81%D1%82%D0%B8-%D0%B0%D1%82%D1%82%D0%B5%D1%81%D1%82%D0%B0%D1%82-%D0%B2-%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%BD%D0%B5%D1%82-%D0%BC%D0%B0%D0%B3%D0%B0%D0%B7%D0%B8%D0%BD%D0%B5
There is definately a lot to know about this subject. I like all the points you have made.
paxlovid buy: paxlovid for sale – paxlovid cost without insurance
Having read this I thought it was really enlightening. I appreciate you taking the time and energy to put this article together. I once again find myself personally spending way too much time both reading and posting comments. But so what, it was still worth it.
Здравствуйте!
Мы можем предложить документы техникумов, расположенных в любом регионе Российской Федерации. Вы имеете возможность приобрести качественно сделанный диплом за любой год, включая документы старого образца СССР. Дипломы и аттестаты делаются на бумаге высшего качества. Это дает возможность делать государственные дипломы, не отличимые от оригиналов. Они заверяются необходимыми печатями и штампами.
facesocial.demo3.dedicatedhost247.com/read-blog/14994
http://clomiddelivery.pro/# can you buy generic clomid without prescription
Добрый день!
Как приобрести аттестат о среднем образовании в Москве и других городах
pro-novostroyki.ru/index.php?showtopic=20846
Рады оказаться полезными!
лучшее бесплатное порно лучшее бесплатное порно .
Здравствуйте!
Как получить диплом техникума с упрощенным обучением в Москве официально
landik-diploms-srednee.ru/diplom-s-reestromkupit-kupit
ciprofloxacin over the counter: buy cipro cheap – where to buy cipro online
http://clomiddelivery.pro/# clomid prices
Привет!
Купить документ о получении высшего образования вы сможете в нашем сервисе. Мы оказываем услуги по изготовлению и продаже документов об окончании любых ВУЗов Российской Федерации. Вы получите необходимый диплом по любой специальности, включая документы Советского Союза. Гарантируем, что при проверке документа работодателем, каких-либо подозрений не возникнет.
Мы изготавливаем дипломы любой профессии по приятным тарифам. Цена зависит от выбранной специальности, года выпуска и образовательного учреждения. Стараемся поддерживать для заказчиков адекватную политику цен. Важно, чтобы дипломы были доступны для большинства наших граждан.
baetezhylefy.timeforchangecounselling.com/kak-mozno-budet-nedorogo-priobresti-diplom-v-internet-magazine
Поможем вам всегда!
Juventus Football Club https://italy.juventus-ar.com is one of the most successful and decorated clubs in the history of Italian and world football.
Chelsea https://england.chelsea-ar.com is one of the most successful English football clubs of our time.
The history of one of France’s https://france.paris-saint-germain-ar.com most famous football clubs, Paris Saint-Germain, began in 1970, when capitalist businessmen Henri Delaunay and Jean-Auguste Delbave founded the club in the Paris Saint-Germain-en-Laye area.
https://doxycyclinedelivery.pro/# doxycycline pills over the counter
Zinedine Zidane https://real-madrid.zinedine-zidane-ar.com the legendary French footballer, entered the annals of football history as a player and coach.