- Posts: 745
- Thank you received: 10
Querying Windows Services
13 years 7 months ago #36920
by Arani
Picking pebbles on the shore of the networking ocean
Querying Windows Services was created 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
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
13 years 7 months ago #36926
by KiLLaBeE
Replied by KiLLaBeE on topic Re: Querying Windows Services
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.
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.
13 years 7 months ago #36930
by Arani
Picking pebbles on the shore of the networking ocean
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."
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
13 years 7 months ago #36935
by KiLLaBeE
Replied by KiLLaBeE on topic Re: Querying Windows Services
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)
[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)
Time to create page: 0.125 seconds