Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
The sc query
command is a powerful tool in the Windows environment for querying the status of services. This command is part of the Service Control (SC) suite of commands, which allows administrators to manage services from the command line. Understanding how to use sc query
can help you monitor and troubleshoot services, ensuring that your Windows environment runs smoothly.
Examples:
Basic Query of All Services: To list all services and their statuses, use the following command:
sc query
This command will display a list of services along with their current state (e.g., RUNNING, STOPPED).
Query a Specific Service: If you need to check the status of a specific service, you can specify the service name:
sc query "ServiceName"
Replace "ServiceName"
with the actual name of the service you want to query. For example, to check the status of the Windows Update service:
sc query wuauserv
Query Services by Type: You can also filter services by type. For instance, to list all services that are drivers, use:
sc query type= driver
Similarly, to list all services that are own processes, use:
sc query type= service
Query Services by State: To list services that are in a specific state, such as RUNNING, use:
sc query state= running
This will list all services that are currently running.
Detailed Query Output:
For more detailed information about a specific service, use the sc qc
command followed by the service name:
sc qc "ServiceName"
This will provide detailed configuration information about the specified service.