How to use the sc command to manage services in Windows
Jul 30, 2025 am 03:53 AMUse sc query to list or check service status, including filtering by state with proper spacing after =; 2. Start or stop services with sc start or sc stop, checking dependencies via sc qc if needed; 3. Configure service settings like startup type with sc config, setting start= auto, demand, or disabled, and modify account or path cautiously; 4. View detailed configuration using sc qc to troubleshoot service properties and dependencies; 5. Create services with sc create by specifying binPath and other parameters, and delete them with sc delete after stopping the service; 6. Send control codes with sc control for advanced service-specific operations, always running Command Prompt as Administrator and testing changes safely—sc enables full command-line service management for scripting and remote administration.
The sc
command in Windows is a powerful command-line tool for managing services—useful for administrators and power users who need to configure, start, stop, or query services without using the graphical Services app (services.msc
). Here's how to use it effectively.

1. Querying Services with sc query
To get information about a specific service or list all services:
sc query
This lists all services and their current status (RUNNING, STOPPED, etc.).

To check a specific service (e.g., Print Spooler):
sc query spooler
You can also filter by state:

sc query type= service state= active sc query state= inactive
Note: There must be a space after the
=
in these commands.
2. Starting and Stopping Services
To start a service:
sc start spooler
To stop a service:
sc stop spooler
?? Some services have dependencies. If a service fails to start, check its dependencies using
sc qc spooler
.
3. Configuring a Service with sc config
You can change a service’s startup type or other parameters.
Set a service to automatic startup:
sc config spooler start= auto
Set to manual:
sc config spooler start= demand
Set to disabled:
sc config spooler start= disabled
Other config options include:
binpath=
to change the executable pathobj=
to change the account the service runs under (e.g.,LocalSystem
,NT Authority\NetworkService
)DisplayName=
to rename the display name
Example:
sc config spooler obj= "LocalSystem" password= ""
? Be cautious with
obj
andpassword
—misconfiguration can break services.
4. Getting Detailed Service Configuration (sc qc
)
To view a service’s configuration (path, startup type, account, etc.):
sc qc spooler
This shows:
- SERVICE_NAME
- TYPE
- START_TYPE (e.g., AUTO_START, DEMAND_START)
- ERROR_CONTROL
- BINARY_PATH_NAME
- LOAD_ORDER_GROUP
- TAG
- DISPLAY_NAME
- DEPENDENCIES
- SERVICE_START_NAME (account it runs under)
Useful for troubleshooting startup issues.
5. Creating and Deleting Services
Create a new service:
sc create MyService binPath= "C:\path\to\program.exe" DisplayName= "My Custom Service" start= auto
Ensure the binary path is correct and the executable supports running as a service.
Delete a service (removes it from the database):
sc delete MyService
?? The service must be stopped before deletion. Also,
sc delete
does not remove the executable file.
6. Sending Control Commands (sc control
)
Some services accept custom control codes. For example, to force the Event Log service to reload:
sc control eventlog 1
(Where 1
is a control code—this is advanced and service-specific.)
Tips and Notes
- Run Command Prompt as Administrator when modifying or controlling services.
- Use double quotes around paths or names with spaces.
- Always test changes in a safe environment.
- Common service names:
winrm
,wuauserv
(Windows Update),dhcp
,dns
,RemoteRegistry
, etc.
Basically, sc
gives you full control over Windows services from the command line—ideal for scripting, remote management, or troubleshooting when GUI tools aren’t available.
The above is the detailed content of How to use the sc command to manage services in Windows. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

If you're having trouble reading your desktop icons' text or simply want to personalize your desktop look, you may be looking for a way to change the font color on desktop icons in Windows 11. Unfortunately, Windows 11 doesn't offer an easy built-in

Fixed Windows 11 Google Chrome not opening Google Chrome is the most popular browser right now, but even it sometimes requires help to open on Windows. Then follow the on-screen instructions to complete the process. After completing the above steps, launch Google Chrome again to see if it works properly now. 5. Delete Chrome User Profile If you are still having problems, it may be time to delete Chrome User Profile. This will delete all your personal information, so be sure to back up all relevant data. Typically, you delete the Chrome user profile through the browser itself. But given that you can't open it, here's another way: Turn on Windo

When Windows cannot detect a second monitor, first check whether the physical connection is normal, including power supply, cable plug-in and interface compatibility, and try to replace the cable or adapter; secondly, update or reinstall the graphics card driver through the Device Manager, and roll back the driver version if necessary; then manually click "Detection" in the display settings to identify the monitor to confirm whether it is correctly identified by the system; finally check whether the monitor input source is switched to the corresponding interface, and confirm whether the graphics card output port connected to the cable is correct. Following the above steps to check in turn, most dual-screen recognition problems can usually be solved.

Mini PCs have undergone

Have problems uploading files in Google Chrome? This may be annoying, right? Whether you are attaching documents to emails, sharing images on social media, or submitting important files for work or school, a smooth file upload process is crucial. So, it can be frustrating if your file uploads continue to fail in Chrome on Windows PC. If you're not ready to give up your favorite browser, here are some tips for fixes that can't upload files on Windows Google Chrome 1. Start with Universal Repair Before we learn about any advanced troubleshooting tips, it's best to try some of the basic solutions mentioned below. Troubleshooting Internet connection issues: Internet connection

When encountering the problem of printing task stuck, clearing the print queue and restarting the PrintSpooler service is an effective solution. First, open the "Device and Printer" interface to find the corresponding printer, right-click the task and select "Cancel" to clear a single task, or click "Cancel all documents" to clear the queue at one time; if the queue is inaccessible, press Win R to enter services.msc to open the service list, find "PrintSpooler" and stop it before starting the service. If necessary, you can manually delete the residual files under the C:\Windows\System32\spool\PRINTERS path to completely solve the problem.

To run command prompts as administrator, the most direct way is to search through the Start menu and right-click "Run as administrator"; secondly, use the Win X shortcut menu to select "Command Prompt (Administrator)" or "Windows Terminal (Administrator)"; you can also open the run window through Win R and enter cmd and press Ctrl Shift Enter to force running as administrator; in addition, you can set shortcut properties to achieve automatic running as administrator. All the above methods require administrator permission and confirmation through UAC. Pay attention to security risks during operation.
