Randon question about software and services.msc

Flybye

Limp Gawd
Joined
Jun 29, 2006
Messages
201
Say you have a piece of hardware that talks to a program which has a service that, when enabled, allows the hardware to talk to a specific website through IE. If the service is running, is it possible for the program to detect if the service has the Startup Type to manual or automatic? And if set to manual to then prevent the hardware from communicating to the website?
 

JVene

n00b
Joined
Apr 25, 2019
Messages
21
Say you have a piece of hardware that talks to a program which has a service that, when enabled, allows the hardware to talk to a specific website through IE. If the service is running, is it possible for the program to detect if the service has the Startup Type to manual or automatic? And if set to manual to then prevent the hardware from communicating to the website?
You're looking for Windows documentation for the function QueryServiceConfig (and related functions and materials), which would allow a program to inquire as to the startup setting and chose actions accordingly.
 

Absalom

Gawd
Joined
Oct 3, 2007
Messages
723
While JVene's answer is a perfectly valid solution, I thought I'd share an alternative solution for those, eh, more programming-challenged.

You can use the following PowerShell commands to query the service's running status and startup type respectively:
Code:
Get-Service -Name "Bonjour Service"

Get-Service -Name "Bonjour Service" | select -property name,starttype
Then it's a matter of parsing the output.
 

Flybye

Limp Gawd
Joined
Jun 29, 2006
Messages
201
Thanks, guys! I just wanted to know how possible is it, and it certainly is. I noticed software only communicating after the startup value was set to automatic. I thought that was very interesting as I've never seen a program use that value as a trigger, but now I know it is totally valid. TY
 
Top