I had a service. I want to know whether the service had been installed on the system or not. I can provide some part of the service name but not entirely.
I have tried couple of commands but couldn't get the result.
sc query
find
Search for Service using Regular Expression
Moderator: DosItHelp
Search for Service using Regular Expression
Last edited by sujitha on 01 Dec 2014 11:33, edited 1 time in total.
Re: Search for Service using Regular Expression
Find all services that begin with the letter W
Code: Select all
T:\>sc query | findstr /I /B /R /C:"^SERVICE_NAME: W.*"
SERVICE_NAME: W32Time
SERVICE_NAME: wcncsvc
SERVICE_NAME: WdiServiceHost
SERVICE_NAME: wdPostMan
SERVICE_NAME: WebClient
SERVICE_NAME: Winmgmt
SERVICE_NAME: Wlansvc
SERVICE_NAME: wmiApSrv
SERVICE_NAME: wscsvc
SERVICE_NAME: WSearch
SERVICE_NAME: wuauserv
SERVICE_NAME: wudfsvc
Re: Search for Service using Regular Expression
I guess this commands only gets the services which are active or in started mode.
Re: Search for Service using Regular Expression
IF you READ the HELP file for the SC command you would see this.
Code: Select all
QUERY and QUERYEX OPTIONS:
If the query command is followed by a service name, the status
for that service is returned. Further options do not apply in
this case. If the query command is followed by nothing or one of
the options listed below, the services are enumerated.
type= Type of services to enumerate (driver, service, all)
(default = service)
state= State of services to enumerate (inactive, all)
(default = active)
bufsize= The size (in bytes) of the enumeration buffer
(default = 4096)
ri= The resume index number at which to begin the enumeration
(default = 0)
group= Service group to enumerate
(default = all groups)
SYNTAX EXAMPLES
sc query - Enumerates status for active services & drivers
sc query eventlog - Displays status for the eventlog service
sc queryex eventlog - Displays extended status for the eventlog service
sc query type= driver - Enumerates only active drivers
sc query type= service - Enumerates only Win32 services
sc query state= all - Enumerates all services & drivers
sc query bufsize= 50 - Enumerates with a 50 byte buffer
sc query ri= 14 - Enumerates with resume index = 14
sc queryex group= "" - Enumerates active services not in a group
sc query type= interact - Enumerates all interactive services
sc query type= driver group= NDIS - Enumerates all NDIS drivers
Code: Select all
sc query type= all state= all | findstr /I /B /R /C:"^SERVICE_NAME: W.*"
Re: Search for Service using Regular Expression
sujitha wrote:I had a service. I want to know whether the service had been installed on the system or not.
When you say installed, that implies it is currently running right?