This post covers how to manage Windows services via the Command Prompt using built-in tools like sc
, net
, and tasklist
.
Manage Windows Services Using Command Prompt
Getting Started
Windows Services are background processes that typically start automatically with Windows and run without user interaction. While the Services graphical interface (services.msc
) is a common way to manage them, power users and administrators often prefer using the Windows Command Prompt for speed, scripting, or remote management.
Open Command Prompt
Before managing services, ensure you're running the Windows Command Prompt with administrative privileges,To open Command Prompt in Administrator Mode, follow the steps for your version of Windows
Using Start Menu- Press
Windows
key or click on Start. - Type:
cmd
orCommand Prompt
. - When it shows up in the results, right-click it.
- Choose "Run as administrator".
- If prompted by User Account Control (UAC), click Yes.
- Press
Windows + R
to open the Rundialog. - Type:
cmd
- Press
Ctrl + Shift + Enter
to open it as administrator.
- Press
Ctrl + Shift + Esc
to open Task Manager. - Click File > Run new task.
- Type:
cmd
- Check the box "Create this task with administrative privileges".
- Click OK.
CMD Commands To Manage Windows Service
Managing Windows services through the Command Prompt is a powerful way to control background processes, here are the Windows command prompt commands list for managing services.
View All Services
sc query type= service state= all
View Running Services
Usingnet
command
net start
Using tasklist
command
tasklist /svc
Check Specific Services
sc query "ServiceName"
Replace "ServiceName" with the actual name of the service (not the display name). For example, spooler for the Print Spooler service.
Find a Service using Display Name
sc getkeyname "Display Name"
Example:
sc getkeyname "Windows Update"
Create or Install a Service
Creating or installing a Windows service can be a bit of a lengthy process. I’ve already written two blog posts that explain the steps in detail. You can find the links below.Start a Service
UsingSC
Command
sc start "ServiceName"
Using NET
Command
net start "ServiceName"
Stop a Service
UsingSC
Command
sc stop "ServiceName"
Using NET
Command
net stop "ServiceName"
Note:-Some services may depend on others. You may need to stop dependent services first.
Restart a Service
UsingSC
Command
sc start "ServiceName" && sc stop "ServiceName"
Using NET
Command
net start "ServiceName" && net stop "ServiceName"
There's no built-in CMD Commands to restart a service, but you can combine stop and start command to restart a service.
Change Service Startup Type
Use sc command, config to change how a service starts
Automatic:sc config "ServiceName" start= auto
Manual:
sc config "ServiceName" start= demand
Disabled:
sc config "ServiceName" start= disabled
Note:-: There must be a space after the = symbol in the sc config command.
Delete a Service
sc delete "ServiceName"
Summary
Managing Windows services through the Command Prompt is a powerful way to control background processes, automate system tasks, or troubleshoot issues without relying on the GUI. It's especially useful for remote administration and scripting.
Thanks