Install the application as a Windows Service
The advantage of installation as a service: It can be automatically started without logging on to the system.
Microsoft official instructions on this tool:
Installand uninstallexecutable services and assigns names to them.
Obviously, this tool is used to install and uninstall executable services and assign service names to these executable services.
So how to use it? Here we want to display D: \ hd.exe with the name of hdsrv as a service, we should do this:
Put instsrv.exe in any directory. There are two ways to execute this command.
A. CMD Method
1. Click Run in the Start Menu, type cmd, and click OK.
2. Run the CD command in cmd to enter the directory where instsrv.exe is located or directly enter the specific path of instsrv.exe. For example, if instsrv.exe is in the D: \ tools directory, we should do this:
Type cd d: \ tools and press enter to enter the directory.
Type instsrv hdsrv D: \ hd.exe and press Enter.
Or
Type D: \ tools \ instsrv.exe hdsrv D: \ hd.exe and press Enter.
3. The service is installed, but the service is not started at this time. We can use the net command to start the service.
Still in cmd
Type Net start hdsrv and press Enter.
4. After starting the service, we can also set the Service Startup type.
Still in cmd
Type SC config hdsrv start = auto start Mode
Type SC config hdsrv start = demand Manual start Mode
Type SC config hdsrv start = disabled. The startup mode is disabled.
B. Gui Method
1. Click Run in the Start Menu]
2. In the "run" text box, type
D: \ tools \ instsrv.exe hdsrv D: \ hd.exe
Click OK.
3. Install and start the service
Click Run in the Start Menu, type services. MSC (not including double quotation marks), and click OK.
4. In Service, right-click the hdsrv service and execute the menu commands such as start, stop, and restart. Double-click to set the Startup type.
If you want to delete this service, follow these steps
Instsrv.exe hdsrv remove
You can delete this service.
Note: Do not use this tool to delete system-related services!