目录
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,然后右键,点击 “启动” 即可。
There’s certainly a lot to know about this subject. I like all the points you’ve made.
Привет, друзья!
Где заказать диплом по актуальной специальности?
Приобрести диплом ВУЗа.
derivsocial.org/read-blog/2583
Bayern Munich’s https://bayern.jamal-musiala-ar.com young midfielder, Jamal Musiala, has become one of the brightest talents in European football.
Thibaut Courtois https://real-madrid.thibaut-courtois-ar.com was born on May 11, 1992 in Belgium.
http://doxycyclinedelivery.pro/# how much is doxycycline 100mg
Здравствуйте!
Мы можем предложить документы техникумов, расположенных в любом регионе России. Вы имеете возможность купить качественно напечатанный диплом за любой год, в том числе документы старого образца. Дипломы и аттестаты выпускаются на бумаге самого высшего качества. Это дает возможность делать настоящие дипломы, которые невозможно отличить от оригинала. Документы будут заверены необходимыми печатями и подписями.
http://www.tosik.ru/forum/index.php?/gallery/image/2-%D0%B7%D0%B0%D0%BA%D0%B0%D0%B7%D1%8B%D0%B2%D0%B0%D0%B5%D0%BC-%D0%B4%D0%B8%D0%BF%D0%BB%D0%BE%D0%BC-%D0%B2-%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%B5%D0%BD%D0%BD%D0%BE%D0%BC-%D0%BC%D0%B0%D0%B3%D0%B0%D0%B7%D0%B8%D0%BD%D0%B5-%D0%BF%D0%BE-%D0%B2%D1%8B%D0%B3%D0%BE%D0%B4%D0%BD%D0%BE%D0%B9-%D1%81%D1%82%D0%BE%D0%B8%D0%BC%D0%BE%D1%81%D1%82%D0%B8/
Hi there! This article could not be written much better! Looking through this post reminds me of my previous roommate! He always kept talking about this. I most certainly will forward this information to him. Pretty sure he will have a good read. Thanks for sharing!
can you buy generic clomid online: can i order generic clomid now – cost of generic clomid without dr prescription
can i get cheap clomid without insurance: where to buy cheap clomid without prescription – where to buy clomid tablets
where to buy cheap clomid online: can i order generic clomid for sale – clomid without insurance
Здравствуйте!
Заказать документ ВУЗа вы сможете в нашей компании в столице.
diploms-x.com/kupit-diplom-bakalavra-ili-specialista
Arsenal https://arsenal.mesut-ozil-ar.com made a high-profile signing in 2013, signing star midfielder Mesut Ozil from Real Madrid.
Здравствуйте!
Заказать документ о получении высшего образования вы имеете возможность в нашем сервисе.
ast-diplomas.com/kupit-diplom-tehnikuma-kolledzha
Привет, друзья!
Мы предлагаем документы техникумов, которые находятся в любом регионе России. Можно купить качественный диплом за любой год, в том числе документы старого образца СССР. Дипломы и аттестаты выпускаются на бумаге самого высокого качества. Это позволяет делать государственные дипломы, не отличимые от оригиналов. Документы будут заверены всеми обязательными печатями и подписями.
shopy.partners/read-blog/1957
https://euroavia24.com – Cheap flights, hotels and transfers around the world!
Rodrigo Goes https://real-madrid.rodrygo-ar.com better known as Rodrigo, is one of the brightest young talents in modern football.
The Saudi Football League https://saudi-arabian-championship.saudi-pro-league-ar.com known as the Saudi Professional League, is one of the most competitive and dynamic leagues in the world.
In an era when many young footballers struggle to find their place at elite clubs, Javi’s https://barcelona.gavi-ar.com story at Barcelona stands out as an exceptional one.
классное порево классное порево .
https://doxycyclinedelivery.pro/# doxycycline capsules 50mg 100mg
Greetings! Very helpful advice in this particular post! It’s the little changes that will make the greatest changes. Thanks a lot for sharing!
Здравствуйте!
Сколько стоит диплом высшего и среднего образования и как его получить?
recept-food.ru/kupite-diplom-i-dostignite-novyih-vershin
Рады оказаться полезными!
I couldn’t resist commenting. Perfectly written!
Привет, друзья!
Заказать документ о получении высшего образования вы имеете возможность в нашем сервисе.
ast-diploms.com/kupit-diplom-perm
http://amoxildelivery.pro/# amoxicillin online canada
самое классное порево klassny-sex.ru .
классное порево бесплатно классное порево бесплатно .
http://clomiddelivery.pro/# can i order generic clomid pill
can i order cheap clomid prices: how can i get cheap clomid no prescription – where buy cheap clomid without insurance
https://amoxildelivery.pro/# amoxicillin 30 capsules price
http://doxycyclinedelivery.pro/# doxycycline 400 mg price
In recent years, the leading positions in the Spanish https://spanish-championship.laliga-ar.com championship have been firmly occupied by two major giants – Barcelona and Real Madrid.
In the German football https://german-championship.bundesliga-football-ar.com championship known as the Bundesliga, rivalries between clubs have always been intense.
The Italian football championship https://italian-championship.serie-a-ar.com known as Serie A, has seen an impressive revival in recent years.
Здравствуйте!
Официальная покупка школьного аттестата с упрощенным обучением в Москве
veniaminv.flybb.ru/viewtopic.php?f=1&t=2866
Рады помочь!
The road to the Premier League https://english-championship.premier-league-ar.com begins long before a team gets promoted to the English Premier League for the first time
The golf https://arabic.golfclub-ar.com industry in the Arab world is growing rapidly, attracting players from all over the world.
https://clomiddelivery.pro/# can i purchase clomid price
doxycycline 50 mg: doxycycline brand – buy cheap doxycycline online
Right here is the right blog for anyone who hopes to understand this topic. You know a whole lot its almost tough to argue with you (not that I actually will need to…HaHa). You definitely put a fresh spin on a subject that has been discussed for decades. Excellent stuff, just excellent.
Привет, друзья!
Заказать документ ВУЗа вы сможете у нас.
diplomyx.com/kupit-diplom-o-srednem-obrazovanii
Успехов в учебе!
Saved as a favorite, I like your web site!
Добрый день!
Приобрести диплом университета.
prof-aksay.ru/blogs/1/bolshoy-assortiment-dokumentov-v-izvestnom-internet-magazine.php
can i get clomid without insurance: clomid buy – how can i get cheap clomid no prescription
Добрый день!
Приобрести диплом любого ВУЗа.
newmedtime.ru/kupit-diplomyi-s-byistroy-dostavkoy
Успехов в учебе!
http://ciprodelivery.pro/# purchase cipro
Привет!
Приобрести документ ВУЗа вы имеете возможность у нас.
ast-diplomy.com/kupit-diplom-nizhnij-novgorod
Удачи!
Привет, друзья!
Официальная покупка диплома вуза с сокращенной программой обучения в Москве
landik-diploms-srednee.ru/kupit-diplom-v-voronezhe В
Здравствуйте!
Заказать документ института
ast-diplom.com/kupit-diplom-nizhnij-novgorod
https://doxycyclinedelivery.pro/# buy doxycycline 500mg