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 can 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 can also use theSet-Servicecmdlet in Powershell or theSc stopcommand in CMD to stop a Windows Service.
Using PowerShell
Before going to the actual process, here’s what the commands do.
Using Command Prompt
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’re able to 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.
Powershell
Command Prompt
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 can use theSet-Servicecmdlet to change the startup type in Powershell. In Command Prompt, you can instead use thesc configcommand.
The acceptable values for thestartparameter are as follows:
How to Fix Can’t Stop Windows Service Because Of Access Denied System Error?
If you launchCMD/PowerShellwithout admin privileges and try to stop a Windows Service, you will encounter this error. To fix this, launch them in elevated mode, and you’ll be able to stop the service.