How to make counter in cmd?

Discussion in 'Software' started by RITESH, Jan 30, 2017.

  1. RITESH

    RITESH

    Joined:
    Jan 16, 2017
    Messages:
    6
    Likes Received:
    0
    Hello,
    How to make 1sec delay count in cmd?
     
    RITESH, Jan 30, 2017
    #1
    1. Advertisements

  2. RITESH

    clifford_cooley VIP Member

    Joined:
    Mar 8, 2009
    Messages:
    5,031
    Likes Received:
    1,192
    Found this page for you. - http://www.wikihow.com/Delay-a-Batch-File
    1. PAUSE
      1. Use the PAUSE command to make the program wait for the user. This will cause the computer to wait for any key to be pressed. The key will not be printed to the screen. If you want to delay for a specific amount of time, see one of the following methods.
      2. Place the PAUSE command where you want the program to wait. The user will be prompted to continue.
      3. Hide the PAUSE dialog. You can add >nul to the end of any command to send its output to the "Null Device" so it doesn't appear on the screen. Make sure you don't add >null to the end; that will create a new file called null and put the output there.
    2. TIMEOUT
      1. Use the TIMEOUT command to make the program wait a specified amount of time. The user can skip this waiting period, or you can apply a parameter that keeps the user from skipping.
        • TIMEOUT may not work with older systems. Try the deprecated SLEEP command if the TIMEOUT command isn't working.
      2. Place the TIMEOUT command where you want the program to wait. Add the flag /t followed by the number of seconds.
      3. Keep the user from skipping the break. Add the flag /nobreak to keep any input from skipping the delay.
        • The user can still end the program by pressing Ctrl + C (keyboard interrupt).
    3. SLEEP
      1. Use the SLEEP command to make the program wait the specified number of seconds. SLEEP is deprecated; if possible TIMEOUT should be used instead.
      2. Place the SLEEP command where you want to program to wait. Add the number of seconds you want it to wait after the SLEEP command. The SLEEP command cannot be interrupted by the user.
    4. PING
      1. Use the PING command to force the program to wait by sending a message to another computer and waiting for a reply. You must ping a non-valid IP address, otherwise a computer might actually reply, and the delay won't be long enough. You cannot ping a non-valid hostname, such as madeup.example.com otherwise error messages will be shown instead of a delay.
      2. Insert the PING command where you want the delay to occur. The -n 1 parameter adds a second ping to the original command. The wait between the two pings, designated by -w 30000, is the delay. The delay has to be entered as milliseconds. Putting >nul at the end will send the command's output to the "Null Device".
     
    clifford_cooley, Jan 30, 2017
    #2
    1. Advertisements

  3. RITESH

    RITESH

    Joined:
    Jan 16, 2017
    Messages:
    6
    Likes Received:
    0
    how ping command work?/
     
    RITESH, Feb 2, 2017
    #3
  4. RITESH

    clifford_cooley VIP Member

    Joined:
    Mar 8, 2009
    Messages:
    5,031
    Likes Received:
    1,192
    Ping has a designated length of time it will wait for a response. The length of time Ping will wait for a non-existent IP address to respond is how long you can make your command-line script wait.

    You probably know as much about Ping as I do. I myself have only used ping a time or two, but never as a form of pausing. I have used pause mostly, sleep with counters, and I believe timeout once.
     
    clifford_cooley, Feb 2, 2017
    #4
  5. RITESH

    RITESH

    Joined:
    Jan 16, 2017
    Messages:
    6
    Likes Received:
    0
    how ping command work in circuit
     
    RITESH, Feb 3, 2017
    #5
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Franky Four Fingers

    infected cmd.exe msiexec removed

    Franky Four Fingers, Oct 9, 2009, in forum: Security
    Replies:
    2
    Views:
    4,072
    Cookieman
    Oct 9, 2009
  2. suneez
    Replies:
    3
    Views:
    5,283
    Kougar
    Dec 22, 2009
  3. Fire cat

    Windows 7 CMD Help & Tips

    Fire cat, May 5, 2010, in forum: Customization
    Replies:
    21
    Views:
    107,804
    Digerati
    Jun 26, 2012
  4. c.c rascal

    begging to use cmd prompt

    c.c rascal, Sep 13, 2010, in forum: Windows 7 Support
    Replies:
    2
    Views:
    2,153
    davehc
    Sep 14, 2010
  5. nev3r

    Cmd.exe / .bat help

    nev3r, Oct 9, 2010, in forum: General Discussion
    Replies:
    1
    Views:
    1,640
  6. teg1545

    move from cmd.exe 32 bit to cmd.exe 64 bit

    teg1545, Oct 12, 2010, in forum: Windows 7 Support
    Replies:
    2
    Views:
    3,502
    teg1545
    Oct 12, 2010
  7. Dond13

    cmd files

    Dond13, Nov 29, 2010, in forum: alt.windows7.general
    Replies:
    35
    Views:
    2,174
    Stan Brown
    Dec 4, 2010
  8. Dond13

    CMD Files Number 2

    Dond13, Dec 2, 2010, in forum: alt.windows7.general
    Replies:
    13
    Views:
    1,349
    Joe Morris
    Dec 3, 2010
Loading...