I'm using a batch file to stop a Windows service. I'm using the sc
command, but I'm open to other ideas, given the question below. The problem is that the batch file proceeds while the service is stopping (the stop
argument to sc
seems only to request the stop -- it doesn't wait for the stop).
How can I modify the batch file to not proceed until the stop is complete?
net stop
will throw a general error code 2 (access denied) if the service is already stopped. – Amoreta