Install the application as a Windows Service

Source: Internet
Author: User
Tags net command

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!

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.