2

I have a service that starts delayed (auto), and I want to create a dependency on a WMI query. It would query WMI and wait until the query returns true before starting the serivce. Is that possible?

2 Answers 2

2

No. You will need another service, process, script, etc. that is set to run on startup to run the WMI query, and when the query is complete it can be start your service.

1

You can write another service that itself watches for the result before finishing starting, or assuming this is a service written in house just move the query into there.

Alternatively set the service to manual and make a scheduled task that on startup spins waiting on your WMI query and starts the service after that. This could also watchdog the service turning it on/off if your WMI query begins to fail.

Personally I think I'd prefer to just build it into the service.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .