Install the application as a windows service using intsrv.exe+srvany.exe

1. What is intsrv.exe and srvany.exe

    instsrv.exe.exe and srvany.exe are two utilities in the Microsoft Windows Resource Kits toolset that 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 automatically started as a Windows service when the machine is started, thereby hiding unnecessary windows, such as: application console, etc. . So we must be wondering if installing srvany.exe can complete the above functions? The answer is correct, but installing srvany.exe requires another tool, instsrv.exe, yes, the function of instsrv.exe is to install the srvany.exe tool, so I believe everyone understands the role of instsrv.exe and srvany.exe , the following is a brief introduction to how to make an exe application into a windows service.

2. Operation steps

    1. Get the app

          slightly

    2. Install srvany.exe with intsrv.exe

    Copy instsrv.exe and srvany.exe to the "C:\WINDOWS\system32" directory (if it is a 64bit system, copy it to C:\WINDOWS\SysWOW64), install srvany.exe with instsrv.exe, and enter dos interface:


C:\Documents and Settings\administrator>C:\WINDOWS\SysWOW64\instsrv.exe MyService C:\WINDOWS\SysWOW64\srvany.exe

Note: Myservice is the name of the custom service, which can be changed according to the application name.
    3. Configure srvany.exe
    Click "Start-Run-regedit" to open the registration list and locate the following path:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService
MyService is the name defined when you installed srvany.exe.
    Under normal circumstances, there is no Parameters item under the service name, and it needs to be created manually: right-click on the service name item to create a new item, name it       
    Parameters, then locate the Parameters item, and create the following string values.
    The name Application value is the address of the program you want to run as a service.
    The name AppDirectory is the path to the folder where the program you want to run as a service is located.
    The name AppParameters value is the parameters required to start the program you want to run as a service.
    The following is an example of a simple applet configuration:


 
After the configuration is complete, the authentication service is as follows:
 

 
So far, the introduction of using instsrv.exe+srvany.exe to install the application as a windows service has been completed. If you have other good suggestions and methods, please give more pointers, thank you!

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326948754&siteId=291194637