Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Batch file pause (Windows XP)

    Is there a way to add a timer to a batch file pause so that the batch file pauses a predetermined length of time.
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch file pause (Windows XP)

    You could use the sleep.exe utility available from Microsoft or an alternative method I've seen used is to ping the local machine:

    <code>ping 127.0.0.1 -n #</code>

    (replacing # with the number of seconds you want the delay for).

  3. #3
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Batch file pause (Windows XP)

    PING -n 6 127.0.0.1 > nul

    |----|----|----|----|----|

    Six PINGs, but five seconds between them, so the figure following -n should be (number of seconds to delay + 1)...
    For larger numbers, of course, there is very little difference!

    The IP address 127.0.0.1 is that of LocalHost, the PC itself, so there is 'almost zero' delay to the PINGing process.
    Occasionally referred to as "home", hence the Officially-Funny Geek Proverb: <big>There's no place like 127.0.0.1...</big> !

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  4. #4
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch file pause (Windows XP)

    I tried using ping and also downloaded the sleep.exe capability. Both will give me the needed pause. Thanks to both of you for your help.
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

  5. #5
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Batch file pause (Windows XP)

    The advantage of using PING is that everyone has it "built-in", and so you don't need to copy it to a directory on the path, as you do for SLEEP...

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •