新建 Windows 服务
添加指向
srvany.exe
的服务1
sc create <name> binpath= "C:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe" start= auto displayname= "<Display Name>"
修改注册表
定位到
1
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<name>
添加子键
1
2Key Name: Parameters
Class : <leave blank>在子键下新建字符串值,指向真正要启动的程序
1
2
3Value Name: Application
Data Type : REG_SZ
String : <path>\<application.ext>进 services.msc 看看,启动
参考:https://support.microsoft.com/en-us/help/137890/how-to-create-a-user-defined-service
All articles in this blog are licensed under CC BY-SA 4.0 unless stating additionally.
Comment