GUI is very popular due to its simplicity and ease of access. But when it comes to managing or automating Windows services, CLI is simply superior and more efficient if you are used to using it.
To stop a Windows servicethrough Command-Line, you may use theStop-Servicecmdlet in PowerShell or theNet stopcommand in CMD.
We’ve provided step-by-step guidelines on how to do so below.
How to Stop a Windows Service From Command Line
In addition to the commands mentioned above, you may also use theSet-Servicecmdlet in Powershell or theSc stopcommand in CMD to stop a Windows Service.
Before going to the actual process, here’s what the commands do.
Sc queryexobtains and displays detailed information about all active services by default. With the use of certain parameters, it can also show info on drivers, their state, and more.
BothNet stopandsc stopcan stop a service. ButNetonly works locally whilesccan be used over a network.
Start/Restart Windows Service from Command Line
In Powershell, you may use thestart-serviceorrestart-servicecmdlets as appropriate. As CMD doesn’t have a command to restart a service directly, we’ll combine thenet stopandnet startcommands instead.
In CMD, you’ll have to stop the service first and restart it afterward. Otherwise, you’ll get aThe requested Service has already been startederror.
Change Windows Service Startup Type from Command Line
you may use theSet-Servicecmdlet to change the startup type in Powershell. In Command Prompt, you can instead use thesc configcommand.
The acceptable values for theStartupTypeparameter are as follows:
The acceptable values for thestartparameter are as follows: