您的位置:首页 > 移动开发

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

2007-11-21 17:54 916 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐