cmd command to install, uninstall, start and stop Windows Service

1. Run -> cmd: cmd to open the command box

2. In the command line Navigate to the location where the InstallUtil.exe

InstallUtil.exe default installation location is C: /Windows/Microsoft.NET/Framework/v2.0.50727 inside, so you want to navigate to the location where cmd (cd C by cd: /Windows/Microsoft.NET/Framework/ v2.0.50727)

3. Operation command:

1) installation services command: Enter the following command at the command line:

InstallUtil.exe  Path/WinServiceName.exe

Where Path represents ServiceName.exe located, press Enter

 

2) Start the service command

net start ServiceName

ServiceName is the real name of the Service's (ServiceBase.ServiceName), with the same name .exe may, or may not be the same. If you are unsure, it is installed inside the service to find your service, right inside look at the service name attribute

 

3) Stop service command

net stop ServiceName

 

4) uninstall the service command: Enter the following command at the command line:

InstallUtil.exe /u  Path/WinServiceName.exe

Where Path represents ServiceName.exe located, press Enter

Guess you like

Origin www.cnblogs.com/kikyoqiang/p/11022293.html