Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Windows Tutorials»How to Add Sleep/Wait in Windows Batch Script

    How to Add Sleep/Wait in Windows Batch Script

    RahulBy RahulMay 27, 20181 Min ReadUpdated: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. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow To Install Nginx on Ubuntu 18.04 & 16.04
    Next Article How to Mount a Samba Share on Ubuntu and Debian

    Related Posts

    How to Clear the ASP.NET Temporary files in Windows

    Updated:June 15, 20221 Min Read

    Creating Python Virtual Environment on Windows

    Updated:June 3, 20222 Mins Read

    How to Enable / disable Firewall in Windows

    Updated:May 17, 20222 Mins Read

    How to Start & Stop Windows Service via Command Line

    Updated:March 29, 20222 Mins Read

    How to Change Windows Hostname (Computer Name)

    Updated:June 2, 20223 Mins Read

    How To Install NVM on Windows

    Updated:April 16, 20223 Mins Read

    7 Comments

    1. Chris Owen on October 17, 2021 1:10 am

      I created a script to change IPs in the stack to commonly used for a project and needed a vanilla set of commands used in CMD to make the change then pause and display that the IPs had changed to the 5 needed for the project. Of Course I made a script to put the table back into DHCP mode. So using commands that wont work in every version of windows would not be advisable.
      I had been looking for a PAUSE before running the IPCONFIG and this works great.

      Reply
      • Chris Owen on October 17, 2021 1:12 am

        I also created a program that pings devices for up and down and a common device that might be on a network and since some of the replacement gear was misconfigured I also scan and alert on that issue too.

        Reply
    2. neon on October 12, 2020 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.

      Reply
    3. viki on June 6, 2019 9:22 am

      what is command for windows 10?

      Reply
      • praveen on February 3, 2020 10:14 am

        timeout will work in window 10 as well

        Reply
    4. Matt on June 30, 2018 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.

      Reply
    5. PJS on June 30, 2018 2:30 am

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

      timeout 5 >nul

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • What is CPU? – Definition, Types and Parts
    • What is the /etc/aliases file
    • What is the /etc/nsswitch.conf file in Linux
    • How to Install Ionic Framework on Ubuntu 22.04
    • What is the /etc/hosts file in Linux
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.