How to register EXE program as a system service method

Source: Internet
Author: User

Recently, our company developed a new product, to run a server program, in order to facilitate I want to be able to register this program as a system service boot automatically start without each reboot of the system to manually start the program. After Baidu and Google two great gods help finally found a solution, here to use Microsoft's two gadgets to provide "Instsrv.exe" and "Srvany.exe."

Instsrv.exe can install and remove services to the system

Srvany.exe can let programs run in a service way

1, first download the two programs and then put in the same directory, I was directly placed in D disk, and then entered the DOS command line to enter the following command to register the service

D:instsrv.exe Tjserver D:srvany.exe//tjserver is the service name

The order is to register the Srvany.exe as a system service.

2, then enter the registry under Hkey_local_machinesystemcurrentcontrolsetservices to find just registered service name Tjserver, a new item in Tjserver, named "Parameters", Click to select it, and then in the window on the right, create a new string value named "Application" and set its value to the path of the program you want to run as a service, for example, my path is "D:toolstjs.exe". Special attention here is that the program path must be written in the same way as in the previous example, is also the middle is separated by a double slash, otherwise the service can not automatically start. If you need to make your registered services look professional and understand better, you can also continue to create a new string value named "Description", in which you can enter the description of the service you want to display.

3, there is also a point of special note is that if you want to do as a service running the program is required after the interface, we can find the management tool in the Control Panel and then open the service or directly run the "services.msc" command to open the service, find the service just created right to open the property, Check the Login tab, login to select the Local System account and select the Allow service to interact with the desktop at the end, so that your service can see the interface when it is started.

4, delete the registered service

Stop the service first, then remove the service with the command "D:instsrv.exe tjserver remove"

There is also a function and instsrv.exe the same interface operation procedures, the name is "Srvinstw.exe", just click the mouse can complete the first step, the detailed use of the method is not said, very simple.

There is a high man on the network wrote a batch file can be a key to automatically register the EXE program into a system service, in order to facilitate and I have the same problem, I will be the program and batch file compression package download link below for more people to benefit.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.