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

3.67
9

                                    SLEEP X_NUMBER_SECONDS

3.67 (9 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how to pause execution for seconds in batch file wait 0.5 seconds in batch file batch pause for 5 seconds wait for something in batch file batch wait 3 seconds wait 2 seconds batch wait seconds batch file batch file sleep 5 seconds batch file delay 5 seconds bat file wait for a few seconds how to wait batch batch wait 1 second batch wait a second batch wait time batch file wait 3 seconds how to make a batch file wait wait batch file wait in batch wait and run file in batch script bat file wait seconds batch file wait for 5 seconds and close delay in batch file wait 5 secind batch file how to make wait in batch file how to wait in batch how to make batch file wait how to pause 5 seconds in batch file wait command in batch file windows batch sleep for 5 seconds how to wait 5 seconds in a batch file batch file wait 30 seconds windows batch wait for seconds batch wait seconds windows batch wait for 10 seconds bat file wait 3 seconds pause batch file for 5 seconds pause batch for 5 seconds how to put wait in batch file give a 5 seconds delay in batch file wait time command in batch file batch file wait for 10 seconds bat file wait for 10 seconds batch file wait 0.5 seconds batch file wait cmd batch file wait seconcs how to wait in batch file wait in batch file batch wait 5 seconds batch file wait seconds wait amount of seconds in batch file how to wait for seconds in batch file how to wait 3 seconds in a batch file batch wait 10 seconds batch file wait for 5 seconds windows batch file wait 5 seconds
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source