Stopping/Starting a remote Windows service and waiting for it to open/close

Posted by ripper234 on Stack Overflow See other posts from Stack Overflow or by ripper234
Published on 2009-09-10T13:38:00Z Indexed on 2010/06/11 20:33 UTC
Read the original article Hit count: 218

Filed under:
|
|

The top answer to this question tells me how to stop/start a remote service. Great. Now, all I need is to wait for the actual stop/start to complete. So, what I'm looking for is a dos command to:

  1. Start a service, should return only after the service is started (or after a timeout, raising error level)
  2. Stop a service, return only after the service is stopped

© Stack Overflow or respective owner

Related posts about Windows

Related posts about windows-services