Stopping/Starting a remote Windows service and waiting for it to open/close
问题 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: Start a service, should return only after the service is started (or after a timeout, raising error level) Stop a service, return only after the service is stopped 回答1: I created a set of batch scripts that use sc.exe to do just this. They are attached below. To run these scripts, you should be a