Skip to main content

Posts

Showing posts with the label Command Prompt

Command line query service status

How to query windows service status using command line?
Sc.exe a command line tool for Windows operating system that every Windows admin should know. The Sys Admin is able to query, list, start or stop Windows services using this tool.

Sc.exe command line tool will help to query service status on local computer, remote computers or servers.
Example below shows the command line to query or list the services state that are running.
Query running services:
sc query | findstr /c:" RUNNING"  /c:"SERVICE_NAME"
Sample output:
SERVICE_NAME: AdobeARMservice
        STATE              : 4  RUNNING SERVICE_NAME: AntiVirSchedulerService
        STATE              : 4  RUNNING SERVICE_NAME: AntiVirService
        STATE              : 4  RUNNING SERVICE_NAME: AppHostSvc
        STATE              : 4  RUNNING SERVICE_NAME: Appinfo
        STATE              : 4  RUNNING SERVICE_NAME: AudioEndpointBuilder
        STATE              : 4  RUNNING SERVICE_NAME: Audiosrv
        STAT…