Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I need a wait ability in a Batch file to wait for a service to stop before it continues to the next command. Here is my code...
sc stop "Backup Exec System Recovery"
del "C:\Documents and Settings\All Users\Application Data\Symantec\FileBackup\catalog.dat"
sc start "Backup Exec System Recovery"I need a wait after the SC because it will not delete the file while the service is still running.

If SC is a exe:
sc stop "Backup Exec System Recovery"
:pause
tasklist | find /i "sc.exe" >nul
if not %errorlevel%==1 goto :pause
del c:\.....

ricardo647's solution should work.
But if you want to wait a certain amount of time, you can do
this:PING -n 11 127.0.0.1 >NUL
That will simply ping your computer 11 times (starting now.)
It will cause the batch file to pause for 10 seconds.

![]() |
VBS String manipulation
|
Finding text and copy usi...
|
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |