Bat File Wait For 10 Seconds Code Example


Example 1: how to wait for seconds in batch file

Windows version: w10 Set LoopVar to whatever number you want. Not exactly 1 second per loop but roughly 1 second. This will count down till it hits zero   the below example waits for 3 seconds and counts down to 1 (not zero)  --------------------------------CODE--------------------------------- @echo off  set LoopVar=3 :Loop PING localhost -n 2 >NUL  ::\/ optional line echo %LoopVar%  set /a LoopVar=%LoopVar%-1 if not %LoopVar%==0 goto Loop  ::\/ optional line pause ----------------------------------------------------------------------  below is simplifed delay without extra bits for pasting convence :) ---------------------------------------------------------------------- @echo off  set LoopVar=3 :Loop PING localhost -n 2 >NUL echo %LoopVar% set /a LoopVar=%LoopVar%-1 if not %LoopVar%==0 goto Loop

Example 2: windows batch file wait 5 seconds

SLEEP X_NUMBER_SECONDS

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?