C # Windows Services: Installing, uninstalling, starting, and stopping Windows service with the cmd command (InstallUtil.exe)

Source: Internet
Author: User

Steps:

1. Run--〉cmd: Open cmd Command box

2. Locate the InstallUtil.exe location on the command line

InstallUtil.exe The default installation location is in c:/windows/microsoft.net/framework/v2.0.50727, so you need to navigate to that location in CMD via CD (CD c:/windows/ microsoft.net/framework/v2.0.50727)

3. Operation Command:

1). Install the service command: Enter the following command at the command line:

InstallUtil.exe Path/winservicename.exe

Where path indicates where the ServiceName.exe is located, enter

2). Start the service command

net start ServiceName

ServiceName is the name of the real Service (Servicebase.servicename), which may or may not be the same as the name of the. exe. If not clear, to the installed services to find your service, right-click on the property to see the service name

3). Stop Service Command

net stop ServiceName

4). Uninstall Service Command: Enter the following command at the command line:

Installutil.exe/u Path/winservicename.exe

Where path indicates where the ServiceName.exe is located, enter

C # Windows Services: Installing, uninstalling, starting, and stopping Windows service with the cmd command (InstallUtil.exe)

Related Article

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.