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)