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).
sc
stop
How can I modify the batch file to not proceed until the stop is complete?
You can use NET stop, which is synchronous, i.e it will wait until the service stops.
NET stop
See - NET stop
1.4m articles
1.4m replys
5 comments
57.0k users