sc query command for status details or sc qc (query config) for configuration data. For human-readable descriptions and dependencies, the wmic utility or PowerShell cmdlets like Get-Service provide extensive metadata including display names, start types, and service descriptions without requiring third-party tools.
Using SC Query for Basic Status
The Service Control (sc) utility is a built-in command-line tool available in all modern versions of Windows. It allows administrators to interact with services directly from the terminal. To check the current state of a specific service, you use the query subcommand followed by the service name. This is particularly useful for scripting automated checks or quick diagnostics.
Run the following command replacing ServiceName with the actual short name of the service:
sc query ServiceName
The output will include several key fields. The STATE field indicates whether the service is stopped, starting, running, or stopping. The WIN32_EXIT_CODE and SERVICE_EXIT_CODE provide error codes if the service failed to start correctly. Additionally, the WAIT_HINT shows how long the system waits for the service to respond during state changes. While this provides immediate status, it does not offer deep configuration details.
Retrieving Configuration Details with SC QC
To get more granular information such as the binary path, start type, and dependencies, use theqc (query config) subcommand. This command reveals how the service is configured to behave upon system startup and where its executable file is located. This is critical when troubleshooting services that fail to start due to incorrect paths or permission issues.
Execute the command below to view the configuration:
sc qc ServiceName
Look for the BINARY_PATH_NAME which specifies the exact location of the executable. The START_TYPE field tells you if the service starts automatically, manually, or is disabled. The DEPENDENCIES line lists other services that must be running before this one can start. If a dependency is missing, the service may fail to launch even if its own configuration is correct.
Getting Descriptions with WMIC
For a more readable format that includes the long description and display name, the Windows Management Instrumentation Command-line (wmic) is effective. Although deprecated in newer Windows 10/11 builds, it remains functional on most systems and provides a clean text output suitable for parsing.
Use this command to fetch the description and name:
wmic service where "name='ServiceName'" get name,displayname,description,state,startmode
This approach returns columns for the service name, its display name as seen in the Services GUI, the detailed description, current state, and start mode. The description often contains vital context about what the service does, which is helpful for identifying unknown services. Note that some descriptions may be localized depending on the system language.
PowerShell Alternatives
Modern Windows environments favor PowerShell for advanced service management. TheGet-Service cmdlet offers a rich object model that can be piped to other commands for filtering or formatting. It provides properties like Status, Name, DisplayName, and CanStop.
Run this command to see detailed service objects:
Get-Service -Name ServiceName | Format-List *
Using Format-List expands all properties vertically, making it easier to read than the default table format. You can also filter for running services only by adding | Where-Object {$_.Status -eq 'Running'}. PowerShell scripts can automate these queries across multiple machines, making it ideal for enterprise administration tasks.
Troubleshooting Common Issues
When querying services, you might encounter access denied errors if you do not run the Command Prompt as an administrator. Always open your terminal with elevated privileges to ensure full access to service configurations. Another common issue is specifying the wrong service name; always use the short service name, not the display name, forsc commands.
If you need to export this information for further analysis, you can redirect the output to a text file. This is similar to techniques used in combining text files via command processes, allowing you to aggregate logs or configurations from multiple sources. Understanding these basic commands forms the foundation for deeper system troubleshooting, akin to diagnosing hardware issues using CLI tools as discussed in troubleshooting hard drive issues.
Frequently Asked Questions
How do I list all services on my computer?
You can list all services by running sc query without specifying a service name, or Get-Service in PowerShell. The sc query output will show every service's state and type, while PowerShell provides a more structured list with additional metadata.
Why does sc query return ACCESS_DENIED?
This error occurs because querying certain service configurations requires administrative privileges. Open your Command Prompt or PowerShell window by right-clicking and selecting "Run as administrator" to resolve this permission issue.
What is the difference between service name and display name?
The service name is the internal identifier used by the operating system and APIs, typically lowercase with no spaces. The display name is the user-friendly label shown in the Services manager GUI, which may contain spaces and capitalization. Use the service name for commands and the display name for identification.
Can I find out who owns a service?
Standard CLI tools do not directly show the owner account. However, you can check the logon account by viewing the service properties in the Services GUI or using PowerShell with Get-CimInstance to query the StartName property, which indicates the account under which the service runs.
Is wmic still supported in Windows 11?
While wmic is deprecated and may be removed in future updates, it currently remains functional in Windows 11 for backward compatibility. Microsoft recommends transitioning to PowerShell cmdlets like Get-CimInstance or Get-WmiObject for new scripts to ensure long-term stability.