|

How To Use The Sc Command In Windows (2026)

The sc command, short for Service Control, talks to the Windows Service Control Manager from the command line.

You can use it to check a service, start or stop it, change its start type, or remove one you created.

This guide uses the syntax and examples from Microsoft Learn.

Table of Contents

Quick answer

TaskCommand
Check one servicesc.exe query wuauserv
List all services, active and inactivesc.exe query state= all
Start a servicesc start <servicename>
Stop a servicesc stop <servicename>
Show a service’s configurationsc qc <servicename>
Change the start typesc.exe config <servicename> start= auto

What sc does

Microsoft says SC.exe retrieves and sets control information about services.

You can use it to configure a specific service, retrieve the current status of a service, and stop and start a service.

Microsoft also says you can write batch files that call sc commands to automate the startup or shutdown sequence of services.

How to open it

  1. Select Start and type cmd.
  2. Right-click Command Prompt and choose Run as administrator.
  3. Type sc and press Enter to list the available commands.
  4. Type a command name such as sc start to see its syntax.

Microsoft shows both of those help steps on its Win32 services page.

See our guide to opening an elevated Command Prompt for other ways in.

The space rule that trips people up

Put a space after every equals sign. Microsoft says each option must include the equals sign as part of its name and a space is required before the value, as in type= own, or the operation fails.

That applies to query, config, and create options such as start=, type=, state=, and binpath=.

Use the service name, not the display name

Microsoft says sc commands take the service name returned by the getkeyname operation.

The service name is the registry subkey name, such as wuauserv, while the display name is the friendly name shown in the interface.

Run sc getkeyname with a display name to look up the service name, or sc getdisplayname to go the other way.

Check a service with sc query

Run sc.exe query wuauserv to show the Windows Update service.

Microsoft says the output includes SERVICE_NAME, TYPE, STATE, WIN32_EXIT_B, SERVICE_EXIT_B, CHECKPOINT, and WAIT_HINT.

CommandResult
sc.exe queryActive services only
sc.exe query state= allAll services, active and inactive
sc.exe query state= inactivePaused or stopped services
sc.exe query type= driverDrivers only
sc.exe query type= all bufsize= 2000Services and drivers with a 2,000-byte buffer

The default buffer is 1,024 bytes, and when output is longer Microsoft says to rerun the command with a bigger bufsize= and the ri= index it reports.

Start and stop a service

Microsoft’s example is sc start tapisrv to start the TAPISRV service.

The matching stop example is sc stop tapisrv, which sends a STOP control request to the service.

Microsoft notes that not all services can be stopped.

You can add sc pause and sc continue for services that support pausing.

Read a service configuration

Run sc qc rpcss to query the configuration of the RPCSS service, which is Microsoft’s own example.

The output covers the type, error control, binary path name, load order group, display name, dependencies, and the account the service starts under.

If the binary name is Services.exe, Microsoft says the service shares the Service Controller process.

Change a start type with sc config

The config operation modifies a service’s entries in the registry and in the Service Control Manager database.

start= valueMeaning
bootA device driver loaded by the boot loader
systemA device driver started during kernel initialization
autoStarts each time the computer restarts, even if no one logs on
demandMust be started manually, and the default if start= is not given
disabledCannot be started until you change the start type
delayed-autoStarts automatically a short time after other auto services

Microsoft’s only config example sets a binary path, as in sc.exe config NewService binpath= c:\windows\system32\NewServ.exe.

Create and delete services

Microsoft says sc create adds a subkey and entries for a service in the registry and in the Service Control Manager database.

Its example is sc.exe create NewService binpath= c:\windows\system32\NewServ.exe, and binpath= has no default so you must supply it.

To remove a service you made, Microsoft’s example is sc delete NewServ.

Do not delete built-in services. Microsoft says it does not recommend using sc delete on built-in operating system services such as DHCP, DNS, or Internet Information Services.

If the service is running or another process holds it open, Microsoft says the service is marked for deletion instead.

More sc operations worth knowing

Microsoft’s SC commands reference lists more operations than most people use.

OperationWhat it does
sc queryexShows detailed information about a service or driver
sc qdescriptionDisplays a service’s description string
sc enumdependLists services that cannot run unless the given service is running
sc qfailureDisplays the actions taken if the service fails
sc interrogateSends an INTERROGATE control request to a service

Enumdepend is useful before you stop a service, because it shows what else depends on it.

Run sc against another computer

Put the server name before the command in UNC format, for example sc \\myserver qc newsrvice.

Omit the server name to run sc on the local computer.

Microsoft says the server name must use the Universal Naming Convention format, which begins with two backslashes.

Common problems

ProblemWhat to check
The operation failsCheck for a space after each equals sign
Access is deniedReopen Command Prompt as administrator
Service not foundUse the service name, not the display name
A service will not stopMicrosoft says not all services can be stopped
Output is cut offRerun query with bufsize= and ri= as the message says

For related command line tools, see our guides to the Tasklist and Taskkill commands and the Schtasks command.

Sources

See the sc.exe query page and the sc.exe config page on Microsoft Learn.

Create and delete are covered on the sc.exe create page and the sc delete page.

The full command list is in the SC commands reference.

Leave a Reply

Your email address will not be published. Required fields are marked *