Skip to main content

Querying Windows Services

More
12 years 9 months ago #36920 by Arani
Hi all

How do I query a service on Windows. whose name has a 'space' in it?

I can query services like Alerter, SNMP successfully, but when I go to query DNS Client, SNMP Trap, it says 'service not installed'.

Looking forward to your help

Picking pebbles on the shore of the networking ocean
More
12 years 9 months ago #36926 by KiLLaBeE
How are you querying the services and what are you looking for when you query them? Just whether they're running or stopped?

Either way, if you open the service itself (by going to Start > Run, type services.msc, hitting OK, and then double-clicking the service), the Path to Executable field will show you the specific .exe for that service. You can query it by specify the executable name (just don't include the ".exe").

Another thing you can try is wrapping the service name in quotes, so doing "DNS Client." But I'm fairly sure querying by the executable name should work. If not, let me know how you're querying them and what info you're trying to retrieve.
More
12 years 9 months ago #36930 by Arani
Replied by Arani on topic ...
Hi there mate

I am using command line command i.e. sc query... and even net query to check status of certain services.

Here's the weird bit. I can query 'snmp trap', but cannot query 'DNS client'

I get this error "[SC] EnumQueryServiceStatus: OpenService FAILED 1060: The specified service does not exist as an installed service."

Picking pebbles on the shore of the networking ocean
More
12 years 9 months ago #36935 by KiLLaBeE
Try:

[code:1]
sc query dnscache
[/code:1]

The name of the service is actually on the 'Service Name' section of the service property name. Or you can just type 'sc query' on the command line, and it'll query everything. Then you can see the name next to 'Service Name' and just query by that name (with no quotes around the name)
More
12 years 8 months ago #36989 by Arani
Replied by Arani on topic ...
Hi mate

I had to do 'dnscache' for dns client, for for SNMP Client, I didn't have to use the actual service name. Now that's confusing

cheers

Picking pebbles on the shore of the networking ocean
Time to create page: 0.145 seconds