Google Reviews
If you find this content or our services useful, please leave us a review.

Sometimes in a batch file we need to wait for a service to stop in a batch file before we continue to processing our script.  NET STOP will only wait a finite amount of time for a service to stop, so for services that take a while to stop we can use a simple loop.  This is just an example of stopping the Adobe update service and waiting – just replace the service name as required:

@echo off

REM Run your command line here - probably: NET STOP AdobeARMservice 
REM Wait for Adobe Update service to stop
sc query AdobeARMservice | find "STOPPED" >nul 2>&1

  Timeout /T 5 /Nobreak
) ELSE (
REM Carry on with more logic


Wait For a Service To Stop in a Batch File
Comments have now been disabled. If you have a question to ask about this post please ask the community!