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.

BlackhawkHub Editorial · Updated

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

cmd
sc query wuauserv
text
SERVICE_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

cmd
sc stop wuauserv
sc start wuauserv

Both 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

cmd
sc qc wuauserv
sc config wuauserv start= demand

sc qc shows the binary path, start type and dependencies. sc config … start= changes the start type:

ValueMeaning
autoStart automatically at boot
delayed-autoStart shortly after boot
demandManual start
disabledCannot 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 query shows 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 stop then sc start).

Common mistakes

  • Omitting the space in start= auto; start=auto fails.
  • 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.

Sources