How to add a exe application run as a service(如何将一个可执行程序当作服务运行)?

来源:互联网 发布:金融大数据研究生 编辑:程序博客网 时间:2024/04/28 15:27

Need two tools:instsrv.exe and srvany.exe

1. Download it from the following link:
http://mooncat.51.net/ls/fu/srvinstw.rar
http://fgg.minidns.net/scripts/lb5000/attachment.cgi?forum=32&topic=116&postno=1&type=.zip

2. Run the following command in dos window to install a service
[path of instsrv.exe] [service name] [path of srvany.exe]


3. Write a .reg file to load some values to registry. Following is a sample in the .reg file.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/service name/Parameters]
"Application"="c://usr//local//bin//dmh_wish.exe"
"AppParameters"="-f dmh84_server startup "
"AppDirectory"="c://usr//local//bin"

4. Run the following command in dos window to remove a service.
[path of instsrv.exe] "[service name]" remove

原创粉丝点击