CMD Simulator
Process Managementsc

SC Command – Manage Windows Services from Command Line

Learn how to use the SC command to query, start, stop, configure, and manage Windows services from CMD. Complete guide with syntax, examples, and troubleshooting tips.

Rojan Acharya·
Share

The SC command (Service Control) is a Windows Command Prompt utility that communicates with the Service Control Manager to query, configure, start, stop, create, delete, and manage Windows services. Use SC to view service status and configuration, change service startup type (automatic, manual, disabled), modify service accounts and dependencies, control service execution, troubleshoot service failures, or automate service management in scripts—essential for system administration, service deployment, and enterprise service lifecycle management.

Whether you're a system administrator managing critical services and configuring service startup behavior across servers, a developer deploying custom services and troubleshooting service dependencies, or a power user controlling service execution to optimize performance and security, SC provides comprehensive command-line access to Windows Service Control Manager functionality. IT professionals rely on SC for automated service deployment, remote service management, and service configuration in enterprise environments.

This comprehensive guide covers SC syntax, all subcommands and parameters, practical examples for querying and managing services, troubleshooting tips for access denied and service failure errors, related service management commands, and frequently asked questions. By the end, you'll confidently use SC for service administration, configuration management, and automated service operations in Windows environments.

What Is the SC Command?

The SC command is a powerful service management tool in Windows Command Prompt that provides direct access to the Service Control Manager (SCM) database, enabling querying, configuration, and control of Windows services from the command line.

SC works in Command Prompt (CMD), Windows PowerShell (with CMD compatibility), Windows Terminal, and is available in Windows 2000 through Windows 11, Windows Server 2000 through Windows Server 2022, and all enterprise editions. Its comprehensive service management capabilities make it superior to the GUI Services snap-in for scripting, automation, and remote management scenarios.

The command supports extensive service operations including query (view status and configuration), start/stop/pause/continue (control execution), config (modify settings), create/delete (service lifecycle), failure (configure recovery), and qc (query configuration). System administrators use SC in deployment scripts to install services, monitoring scripts to verify service status, maintenance scripts to restart failed services, and security scripts to disable unnecessary services.

SC vs Services Management Console

While the Services MMC snap-in (services.msc) provides a graphical interface, SC offers:

  1. Command-line automation – Scriptable service management for deployment and maintenance
  2. Remote computer access – Manage services on network computers without RDP
  3. Bulk operations – Query and modify multiple services with scripting loops
  4. Advanced configuration – Access to service settings not available in GUI

Most enterprise service management and deployment scripts use SC for its scriptability and remote management capabilities.

Syntax

SC [servername] command [servicename] [options]

Common Commands

CommandDescription
queryQueries the status of a service, or enumerates status for all services
qcQueries the configuration information for a service
startStarts a service
stopStops a service
pausePauses a service
continueResumes a paused service
configChanges the configuration of a service (persistent)
createCreates a service (adds it to the registry)
deleteDeletes a service (from the registry)
failureConfigures actions to take upon service failure
qfailureQueries the actions taken on service failure
descriptionSets or queries the description of a service

Common Parameters

ParameterDescription
\\servernameRemote computer name (use \\computername or \\IP)
type=Service type (own, share, kernel, filesys, interact)
start=Startup type (boot, system, auto, demand, disabled)
error=Error severity (normal, severe, critical, ignore)
binpath=Path to service executable
obj=Account name to run service (LocalSystem, NT AUTHORITY..., or domain\user)
password=Password for service account (if account requires one)
depend=Services or groups this service depends on

Server specification: Use \\servername immediately after SC to manage services on remote computers.

Service names: Use actual service name (not display name). Find service names with SC query or check registry under HKLM\SYSTEM\CurrentControlSet\Services.

How to Use SC Command

Query All Services

List all services and their status:

SC query
SC query type= service
SC query state= all

Without parameters, shows only running services. Use state= all to include stopped services. Note the space after the equal sign (required syntax).

Query Specific Service

Display status of a single service:

SC query wuauserv
SC query spooler
SC query W32Time

Shows service state (RUNNING, STOPPED, PAUSED), service type, and current status information. Use actual service name, not display name.

Query Service Configuration

View detailed service configuration:

SC qc wuauserv
SC qc spooler
SC qc EventLog

Displays service type, startup type, error control, binary path, dependencies, service account, and display name. Essential for understanding service configuration.

Start a Service

Launch a stopped service:

SC start wuauserv
SC start spooler
SC start W32Time

Sends start command to service. Returns immediately—use SC query servicename to verify service started successfully.

Stop a Service

Terminate a running service:

SC stop wuauserv
SC stop spooler
SC stop Schedule

Sends stop signal to service. Some services cannot be stopped (protected system services). Returns immediately—verify with query.

Configure Service Startup Type

Change how a service starts at boot:

SC config wuauserv start= auto
SC config spooler start= demand
SC config SysMain start= disabled

Startup types: auto (automatic), demand (manual), disabled (disabled), delayed-auto (automatic delayed start). Space after = is required.

Change Service Account

Modify the account a service runs under:

SC config servicename obj= LocalSystem
SC config servicename obj= "NT AUTHORITY\NetworkService"
SC config servicename obj= domain\serviceaccount password= P@ssw0rd

Use LocalSystem, LocalService, NetworkService, or domain accounts. Password required for domain accounts. Enclose values with spaces in quotes.

Set Service Dependencies

Configure service dependencies:

SC config servicename depend= DependencyService
SC config servicename depend= Service1/Service2/Service3

Service won't start until dependencies are running. Use / to separate multiple dependencies. Remove dependencies with depend= "".

Query Services on Remote Computer

View services on a network computer:

SC \\remotecomputer query
SC \\192.168.1.100 query wuauserv
SC \\SERVER01 qc spooler

Requires administrative privileges on remote computer. Use \\computername or \\IPaddress format immediately after SC.

Create a New Service

Install a service in the system:

SC create MyService binpath= "C:\Services\MyService.exe"
SC create TestSvc binpath= "C:\Test\service.exe" start= auto displayname= "Test Service"

Minimum requirement is binpath=. Use start=, displayname=, obj=, and other parameters to configure. Service name must be unique.

Delete a Service

Remove a service from the system:

SC delete MyService
SC delete TestSvc

Service must be stopped first. Removes service from registry—doesn't delete executable file. Use cautiously on production systems.

Configure Failure Actions

Set recovery actions for service failures:

SC failure wuauserv reset= 86400 actions= restart/60000/restart/60000/reboot/1000
SC failure servicename reset= 3600 actions= restart/5000

Actions: restart (restart service), reboot (reboot computer), run (run command). Values after / are delay in milliseconds. reset= specifies failure count reset period in seconds.

Query Failure Configuration

View service recovery settings:

SC qfailure wuauserv
SC qfailure spooler

Shows failure reset period and recovery actions configured for the service.

Set Service Description

Add or modify service description:

SC description wuauserv "Enables download and installation of Windows updates"
SC description MyService "Custom application service for data processing"

Description appears in Services console and SC qc output. Useful for documenting custom services.

Pause and Resume Services

Temporarily suspend and resume service execution:

SC pause servicename
SC continue servicename

Not all services support pause/continue. Paused services remain running but stop processing requests. Use for maintenance without full service restart.

Common Use Cases

  1. Verify service status – Use SC query servicename to check if critical services are running during troubleshooting and monitoring.

  2. Restart hung services – Use SC stop servicename && SC start servicename to restart services that become unresponsive or fail.

  3. Disable unnecessary services – Use SC config servicename start= disabled to prevent services from starting for performance or security optimization.

  4. Configure automatic service startup – Use SC config servicename start= auto to ensure critical services start at boot in deployment scripts.

  5. Set service recovery actions – Use SC failure servicename actions= restart/60000 to configure automatic service restart on failure for high availability.

  6. Remote service management – Use SC \\remotepc query to monitor and manage services on network servers without remote desktop access.

  7. Deploy custom services – Use SC create servicename binpath= ... to install custom application services during software deployment.

  8. Change service accounts – Use SC config servicename obj= domain\account password= pass to run services under specific accounts for security requirements.

  9. Troubleshoot service dependencies – Use SC qc servicename to identify dependencies when services fail to start or have startup issues.

  10. Automate service maintenance – Use SC commands in scheduled tasks or monitoring scripts to restart failed services and maintain service health.

  11. Security hardening – Use SC config servicename start= disabled to disable vulnerable or unnecessary services as part of security baseline.

  12. Backup service configuration – Use SC qc servicename > backup.txt to document service configurations before making changes.

Tips and Best Practices

  1. Always use space after equals sign – SC syntax requires start= auto (not start=auto). Missing space causes syntax errors.

  2. Run as Administrator for most operations – Elevate Command Prompt for service configuration, start/stop, create/delete operations.

  3. Use service name, not display name – Find actual service name with SC query or in registry; display names don't work in SC commands.

  4. Verify service state after changes – Use SC query servicename after start/stop/config to confirm operation succeeded.

  5. Quote values containing spaces – Use SC config servicename displayname= "My Service Name" for values with spaces.

  6. Stop services before deleting – Always SC stop servicename before SC delete servicename to avoid locked services.

  7. Configure failure actions for critical services – Use SC failure to set automatic restart for services critical to operations.

  8. Use delayed-auto for startup optimization – Set start= delayed-auto for non-critical services to improve boot time performance.

  9. Document service changes – Log SC commands or save output when modifying production services for audit trails.

  10. Test remote commands locally first – Verify SC commands work on local machine before executing on remote systems.

  11. Use NET START/STOP for simpler operations – For basic start/stop without configuration, NET START servicename is simpler syntax.

  12. Check dependencies before stopping services – Use SC qc servicename to see dependent services to avoid cascading failures.

Troubleshooting Common Issues

Access Denied Error

Problem: SC query servicename returns "ERROR: Access is denied."

Cause: Insufficient permissions to query or manage services, especially on remote computers.

Solution: Run Command Prompt as Administrator:

  1. Right-click Command Prompt
  2. Select "Run as administrator"
  3. Run SC query servicename

For remote computers, ensure you have administrative privileges:

SC \\remotepc query servicename

Use explicit credentials if needed via RUNAS or connect with administrative account.

Prevention: Always run elevated Command Prompt for service management; verify administrative permissions on remote systems.

OpenService FAILED 1060: Service Does Not Exist

Problem: SC query MyService returns "OpenService FAILED 1060: The specified service does not exist."

Cause: Service name is incorrect, service doesn't exist, or using display name instead of service name.

Solution: List all services to find correct name:

SC query | FINDSTR /I "display"

Or check Services console for service name (not display name). Use exact service name:

SC query wuauserv

Prevention: Always verify service name with SC query or Services console before running commands; service names are case-insensitive but spelling must be exact.

StartService FAILED 1053: Service Did Not Respond

Problem: SC start servicename returns "ERROR 1053: The service did not respond to the start or control request in a timely fashion."

Cause: Service startup code is taking too long, service executable path is incorrect, or service dependencies aren't running.

Solution: Check service configuration and dependencies:

SC qc servicename

Verify binary path is correct and file exists. Check dependencies are running:

SC query dependencyservice

Increase service timeout in registry (advanced) or fix service startup code.

Prevention: Ensure service executables are in correct locations, dependencies are configured properly, and service startup code completes quickly.

Syntax Error: Space Required After Equals Sign

Problem: SC config servicename start=auto returns syntax error.

Cause: SC requires space after equals sign in parameters.

Solution: Always include space after =:

SC config servicename start= auto
SC config servicename obj= LocalSystem

Prevention: Remember SC syntax requirement: parameter= value (space after equals).

Cannot Stop Service - Dependent Services Running

Problem: SC stop servicename returns error about dependent services.

Cause: Other services depend on this service and are currently running.

Solution: Stop dependent services first:

SC query servicename

Identify dependent services, stop them, then stop target service. Or use NET STOP with /Y to stop dependencies:

NET STOP servicename /Y

Prevention: Check service dependencies with SC qc before stopping; plan service shutdown order in scripts.

Service Won't Start - Error 1068: Dependency Failed

Problem: SC start servicename returns "ERROR 1068: The dependency service or group failed to start."

Cause: A service this service depends on is not running or is disabled.

Solution: Check service dependencies:

SC qc servicename

Start dependency services first:

SC start dependencyservice
SC start servicename

Or change startup type of dependency to automatic:

SC config dependencyservice start= auto

Prevention: Configure service dependencies correctly during service creation; ensure dependency services are enabled and running.

Related Commands

NET START / NET STOP – Simple Service Control

NET START and NET STOP provide simpler syntax for starting and stopping services without configuration options.

Example:

NET START "Windows Update"
NET STOP "Print Spooler"

Difference: NET commands use display names and simpler syntax; SC provides complete service management including configuration. Use NET for basic start/stop, SC for advanced management.

TASKLIST /SVC – View Service-to-Process Mapping

TASKLIST /SVC shows which services run in each process, useful for identifying service executables and troubleshooting.

Example:

TASKLIST /SVC
TASKLIST /SVC /FI "IMAGENAME eq svchost.exe"

Integration: Use TASKLIST to identify which process hosts a service, then SC to manage the service.

WMIC SERVICE – WMI-Based Service Management

WMIC SERVICE provides service management through Windows Management Instrumentation with powerful filtering and querying.

Example:

WMIC SERVICE WHERE "name='wuauserv'" GET Name,State,StartMode
WMIC SERVICE WHERE "State='Running'" GET Name,ProcessId

When to use: WMIC offers more advanced querying and filtering; use SC for standard operations, WMIC for complex queries.

SERVICES.MSC – Services Management Console

SERVICES.MSC is the GUI tool for service management. Use SC for automation, Services console for interactive management.

Example:

services.msc

Integration: Use Services console for visual service management and configuration discovery; use SC in scripts for automation.

SCHTASKS – Task Scheduler

SCHTASKS schedules programs to run at specific times. Use with SC to schedule service restarts or maintenance operations.

Example:

SCHTASKS /CREATE /SC DAILY /TN "Restart Service" /TR "SC restart servicename" /ST 02:00

When to use: Combine SCHTASKS and SC for scheduled service maintenance and automated service restarts.

POWERSHELL SERVICE CMDLETS – PowerShell Service Management

Get-Service, Start-Service, Stop-Service in PowerShell provide object-based service management.

Example:

Get-Service wuauserv
Start-Service wuauserv
Get-Service | Where-Object {$_.Status -eq "Running"}

Modern alternative: PowerShell cmdlets offer more powerful filtering and pipeline operations; use SC for CMD compatibility or simple scripts.

Frequently Asked Questions

What does SC command do?

SC (Service Control) communicates with Windows Service Control Manager to query, configure, start, stop, create, delete, and manage Windows services. Use SC to view service status with SC query, start/stop services with SC start/stop, change startup type with SC config start=, configure service accounts, set failure recovery actions, and manage services on remote computers. Essential for service administration and automation.

How do I start a Windows service with SC?

Use SC start servicename to start a stopped service. Example: SC start wuauserv starts Windows Update service. Run Command Prompt as Administrator for most services. Verify startup with SC query servicename. To ensure service starts at boot, use SC config servicename start= auto. Service must not be disabled and dependencies must be running.

What is the difference between SC and NET START?

SC provides comprehensive service management (query, config, create, delete, failure actions) while NET START only starts services. SC uses service names (e.g., wuauserv), NET START uses display names (e.g., "Windows Update"). SC syntax requires space after equals (e.g., start= auto). Use NET START for quick service starting, SC for complete service management and automation.

How do I query service status with SC?

Use SC query servicename for specific service or SC query for all running services. Example: SC query wuauserv shows Windows Update status. For all services including stopped: SC query state= all. For configuration details: SC qc servicename. On remote computer: SC \\remotepc query servicename. Output shows state (RUNNING, STOPPED), type, and status information.

How do I change service startup type with SC?

Use SC config servicename start= type where type is auto (automatic), demand (manual), disabled, or delayed-auto (automatic delayed). Examples: SC config wuauserv start= auto enables automatic startup, SC config SysMain start= disabled disables service. Note: space after equals is required. Run as Administrator. Verify with SC qc servicename.

Can SC manage services on remote computers?

Yes, use \\servername immediately after SC: SC \\remotepc query servicename. Examples: SC \\SERVER01 query, SC \\192.168.1.100 start wuauserv. Requires administrative privileges on remote computer, Remote Registry service running, and firewall allowing RPC traffic (TCP 135). Works for query, start, stop, config, and all SC commands.

How do I create a service with SC?

Use SC create servicename binpath= "C:\path\service.exe" where binpath is the executable path. Example: SC create MyService binpath= "C:\Services\MyService.exe" start= auto displayname= "My Service". Additional parameters: start= (startup type), obj= (service account), depend= (dependencies). Run as Administrator. Delete with SC delete servicename after stopping.

Why does SC require space after equals sign?

SC command syntax mandates space after = to separate parameter from value: start= auto (correct) not start=auto (error). This unique syntax differentiates SC from most Windows commands. Example: SC config servicename start= demand obj= LocalSystem. If syntax error occurs, verify space after every equals sign. This applies to all SC parameters.

How do I set service recovery actions with SC?

Use SC failure servicename reset= seconds actions= action1/delay1/action2/delay2. Example: SC failure wuauserv reset= 86400 actions= restart/60000/restart/60000/reboot/1000 restarts service after 1 minute on first two failures, reboots on third failure, resets count after 24 hours (86400 seconds). Actions: restart, reboot, run. Delays in milliseconds. Query with SC qfailure servicename.

What service account options are available with SC?

Use SC config servicename obj= account password= pass to set service account. Options: LocalSystem (highest privileges, no password), LocalService (limited privileges, no password), NetworkService (network access, no password), or domain\username (domain account, password required). Example: SC config servicename obj= "NT AUTHORITY\NetworkService". Enclose accounts with spaces in quotes. Run as Administrator.

How do I find the actual service name vs display name?

Run SC query to list all services—service name appears after "SERVICE_NAME:", display name after "DISPLAY_NAME:". Or check Services console: service name is in parentheses in service properties. Example: display name "Windows Update" has service name "wuauserv". SC commands require service name, not display name. Service names are case-insensitive but must be spelled exactly.

Can I use SC to stop services that won't stop normally?

SC sends standard stop request like Services console—it doesn't force termination. For hung services, try SC stop servicename first. If it doesn't respond, use TASKKILL /F to forcefully terminate the service process (find PID with TASKLIST /SVC). Example: TASKLIST /SVC | FINDSTR servicename then TASKKILL /F /PID processid. Forced termination bypasses cleanup—use as last resort.

Quick Reference Card

CommandPurposeExample Use Case
SC queryList all servicesService inventory
SC query servicenameCheck service statusVerify service running
SC qc servicenameQuery configurationView startup type, account
SC start servicenameStart serviceLaunch stopped service
SC stop servicenameStop serviceTerminate running service
SC config servicename start= autoSet startup typeEnable automatic start
SC config servicename obj= accountChange service accountSet security context
SC failure servicename actions= restart/60000Configure recoveryAuto-restart on failure
SC create servicename binpath= pathInstall serviceDeploy custom service
SC delete servicenameRemove serviceUninstall service
SC \\remote queryRemote managementManage network services

Try SC Command Now

Ready to practice Windows service management? Use our Windows Command Simulator to run SC commands safely in your browser. No installation required—practice SC query, service start/stop, configuration changes, and service administration in a risk-free environment. Perfect for learning, training, or testing command sequences before running them on production systems.

Explore the full Commands Reference for more Windows CMD utilities, including process management (TASKLIST, TASKKILL, START), system administration (NET, SCHTASKS), and diagnostic tools.

Summary

The SC command is the essential Windows tool for managing services from the command line. Use SC to query service status with query, view configuration with qc, start and stop services with start/stop, change startup type with config start=, modify service accounts with config obj=, configure failure recovery with failure, create new services with create, and manage services on remote computers with \\servername.

Start with basic queries (SC query servicename), progress to service control (SC start/stop), master configuration changes (SC config servicename start= auto), and implement failure recovery for critical services (SC failure servicename actions= restart/60000). Master SC for service deployment, maintenance automation, remote service management, and enterprise service lifecycle management in Windows environments.

Understanding SC is fundamental to Windows service administration and automation. The command's comprehensive service management capabilities, remote access support, and scriptable interface make it indispensable for IT professionals deploying custom services, automating service maintenance, troubleshooting service failures, and managing services across enterprise Windows server and desktop infrastructure.