The Service Controller (sc) command in CMD is used to communicate with the Service Control Manager and services on a local or remote machine. It allows you to manage services by starting, stopping, querying, or configuring their properties.

Basic Commands for Managing Services

Querying a Service

To get the status of a service, use the following command:

sc qc "ServiceName"
  • qc: Queries the configuration of the specified service.

Example

sc qc "wuauserv"

This command queries the configuration of the Windows Update service.

Starting a Service

To start a service that is not currently running:

sc start "ServiceName"

Example

sc start "wuauserv"

This starts the Windows Update service.

Stopping a Service

To stop a running service:

sc stop "ServiceName"

Example

sc stop "wuauserv"

This stops the Windows Update service.

Pausing and Resuming a Service

To pause a service that supports pausing:

sc pause "ServiceName"

To resume a paused service:

sc continue "ServiceName"

Example

sc pause "wuauserv"
sc continue "wuauserv"

This pauses and then resumes the Windows Update service.

Creating a Service

You can create a new service by using the sc create command:

sc create "ServiceName" binPath= "path_to_executable"
  • binPath: The path to the executable for the service.

Example

sc create "MyService" binPath= "C:\path\to\service.exe"

This creates a new service named MyService using the specified executable.

Deleting a Service

To delete an existing service:

sc delete "ServiceName"

Example

sc delete "MyService"

This deletes the MyService service.

Configuring a Service

You can configure the startup type of a service (e.g., manual, automatic, disabled) using the sc config command:

sc config "ServiceName" start= type
  • start=: The desired startup type (e.g., auto, demand, disabled).

Example

sc config "wuauserv" start= auto

This sets the Windows Update service to start automatically.

Common Service States

StateDescription
runningThe service is currently running.
stoppedThe service is not running.
pausedThe service is temporarily paused.

Key Commands Comparison

CommandDescriptionExample
sc startStarts a servicesc start "wuauserv"
sc stopStops a running servicesc stop "wuauserv"
sc pausePauses a servicesc pause "wuauserv"
sc continueResumes a paused servicesc continue "wuauserv"
sc createCreates a new servicesc create "MyService" binPath= "C:\path\to\service.exe"
sc deleteDeletes a servicesc delete "MyService"
sc configConfigures service propertiessc config "wuauserv" start= auto