Net learning: use srvany.exe to install the console program as a windows service

1. Introduction to srvany.exe intsrv.exe.exe
and srvany.exe are two utility tools in the Microsoft Windows Resource Kits tool set. These two tools can be used together to run any exe application as a window service. srany.exe is the service shell of the registered program, through which the application can be started with the system account, and the application can be started automatically as a service machine of windows, thereby hiding unnecessary windows, such as application console, etc. . So we must be wondering whether the above functions can be completed by installing srvany.exe? The answer is correct, but the installation of srvany.exe requires another tool, intsrv.exe, yes, the role of intsrv.exe is to install the srvany.exe tool, so I believe everyone understands the role of intsrv.exe and srvany.exe , The following briefly introduces how to make exe applications into windows services.
2. Operation steps
1. Obtain the application, put it in a suitable location, open it as a cmd super administrator, instsrv.exe.exe and srvany.exe can be put together with the application, the installation service is shown in the figure:
Insert picture description here
instsrv.exe location QuartzTest The location of srvany.exe, where QuartzTest is the customized service name.
2. Configure srvany.exe (modify the registry).
Click "Start-Run-regedit" to open the registration list and locate the following path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services \QuartzTest
Generally, there is no Parameters item under the service name, and you need to create it manually: right-click the service name item to create a new item, and the name is

Parameters,然后定位到Parameters项,新建以下几个字符串值。
名称 Application 值为你要作为服务运行的程序地址。
名称 AppDirectory 值为你要作为服务运行的程序所在文件夹路径。
名称 AppParameters 值为你要作为服务运行的程序启动所需要的参数。

Insert picture description hereAfter the configuration is complete, the verification service is as follows:
Insert picture description here
4. Uninstall the service
intsrv.exe location QuartzTest remove uninstall the service, as shown in the figure:
Insert picture description here

So far the service configuration is complete!

Guess you like

Origin blog.csdn.net/weixin_41812784/article/details/106528561