admin avatar

Super simple, method for registering program or software as system service under windows system

🕐 by admin





Super simple, method for registering program or software as system service under windows system

This demand is mainly based on the fact that software or programs can run in the background under the windows system

Or start it up to achieve unconscious operation. . . Very convenient and easy to use

Here mainly introduces the open source winsw tool, winsw download address is as follows

https://github.com/kohsuke/winsw/releases

The download version here is the version of .net4. . . As shown below

Renamed to a simple and easy to remember name, here renamed to winsw.exe

Copy winsw.exe to the program or software directory, here t r o j a n as an example

Create a new winsw.xml file, this must have the same name as the above winsw.exe,

For example, if you renamed WinSW.NET4.exe then the file name must be WinSW.NET4.xml

winsw.xml file content is as follows, fill in according to your needs

1
2
3
4
5
6
7
<service>
  <id> myT * r o * j a n </id>
  <name> T * r o * j * a n </name>
  <description> none description </description>
  <executable> t * r * o * j a n </executable>
  <logmode>rotate</logmode>
</service>
For some special reasons, the above code adds spaces and matches, please delete it yourself

1
<executable> This is the name of the program / software that needs to be registered as a system service. No exe suffix is ​​required.
Launch Windows PowerShell or cmd command window with administrator privileges,

Enter the program or software root directory

Execute the following command to register as a system service

1
.\winsw.exe install

If successful, the following message will be displayed

1
2
3
#.\winsw.exe install
2020-03-04 19: 40: 24,648 INFO-Installing the service with id 'myT * r * o
 j * a * n '
See if the system service is successfully installed

If you want to uninstall the service, execute the following command

1
.\winsw.exe uninstall





💘 相关文章


📝 有偿服务

• 服务器合租380/年
• 服务器配置:2.4G,6核12线程
• nvme raid 1硬盘
• 不提供服务器自主面板
• 适合稳定的个人博客
• 提供备份服务,备份空间自备
• 只提供ipv6地址,搭配cloudflare使用
• 提供想要安装的程序和域名
• 博客必须是和谐健康的
• 博客不能是视频和图片站
• 提供以下付费服务
• 建站,FTP,备份,Linux,Wordpress等建站问题咨询管理
• 加微信:344452500(不闲聊,直接说事)

写一条评论

Based on Golang + fastHTTP + sdb | go1.16.8 Processed in 0ms