COMMAND
scQuery and control Windows services
sc (service control) queries and manages Windows services from the command line. sc query shows status, sc start and sc stop control a service, sc config changes its start type, and sc qc shows its configuration. It talks to the same Service Control Manager as the Services console.
Purpose
sc is the command-line interface to the Service Control Manager. It queries service state, starts and stops services, and reads or changes their configuration. It is more capable than net start / net stop and works well in scripts.
Query status
sc query wuauservSERVICE_NAME: wuauserv
STATE : 4 RUNNING
WIN32_EXIT_CODE : 0 (0x0)sc query with no name lists active services; sc query state= all includes stopped ones (mind the space after state=).
Start and stop
sc stop wuauserv
sc start wuauservBoth need an elevated prompt. The simpler equivalents are net stop "Windows Update" and net start "Windows Update", which take the display name.
View and change configuration
sc qc wuauserv
sc config wuauserv start= demandsc qc shows the binary path, start type and dependencies. sc config … start= changes the start type:
| Value | Meaning |
|---|---|
auto | Start automatically at boot |
delayed-auto | Start shortly after boot |
demand | Manual start |
disabled | Cannot start |
The space after start= (and state=, type=) is required by sc's parser.
Find what a service is hosted by
Many services run inside svchost.exe. sc qc <name> shows the shared svchost.exe -k <group> command line, and tasklist /svc maps running svchost PIDs to services.
Common uses
- Diagnose a service that will not start;
sc queryshows the exit code, and a 1053 timeout points to a slow or hung start. - Disable an unwanted service's automatic start.
- Restart a stuck service (
sc stopthensc start).
Common mistakes
- Omitting the space in
start= auto;start=autofails. - Using the display name with sc; sc needs the short service name, while net accepts the display name in quotes.
- Killing the process instead of stopping the service with taskkill, which bypasses the Service Control Manager and can leave the service in an odd state.
PowerShell equivalent
Get-Service, Start-Service, Stop-Service, Set-Service -StartupType, and Get-CimInstance Win32_Service for the binary path and host details.
Frequently asked questions
sc vs net start?
net start "Service" and net stop "Service" are simpler for just starting and stopping. sc does more: query status, change start type, view and edit configuration, create and delete services. Use net for quick control, sc for everything else.
How do I find a service's real name?
The Services console shows display names; sc needs the short service name. sc query | findstr /i "SERVICE_NAME" lists them, or right-click a service in services.msc → Properties to see its "Service name".
How do I stop a service starting at boot?
sc config "ServiceName" start= disabled (note the space after start=). Use demand for manual start, auto for automatic, delayed-auto for delayed automatic.