• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Add Sleep/Wait in Windows Batch Script

Written by Rahul, Updated on June 29, 2018

You can use timeout command to wait for command prompt or batch script for the specified amount of time. The time is defined in Seconds.

For example to wait for 5 seconds use. Use /T options:

c:/> timeout /T 5

You can also specify seconds directly like:

c:/> timeout 5

The above commands will break the timeout process on pressing any key. You can use /NOBREAK ignore key presses and wait for the specified time.

c:/> timeout /T 5 /NOBREAK

Windows XP users use sleep command instead of the timeout.

c:/> sleep 5

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

5 Comments

  1. Avatar neon Reply
    October 12, 2020 at 3:29 pm

    `sleep’ is so much simpler and easier to use and is “native” to cmd

    :\> sleep 3

    Will sleep script/command line for 3 seconds.

  2. Avatar viki Reply
    June 6, 2019 at 9:22 am

    what is command for windows 10?

    • Avatar praveen Reply
      February 3, 2020 at 10:14 am

      timeout will work in window 10 as well

  3. Avatar Matt Reply
    June 30, 2018 at 2:34 am

    I am using PowerShell on my system, so I just execute this command:

    powershell -command "Start-Sleep -s 5"
    

    Hope this help every one.

  4. Avatar PJS Reply
    June 30, 2018 at 2:30 am

    You can use timeout as well as this will not be visible

    timeout 5 >nul

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Ubuntu 20.04 5
  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • (Solved) apt-add-repository command not found – Ubuntu & Debian 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy