Results 1 to 8 of 8

Thread: BAT file sleep

  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    BAT file sleep

    I have two batch files. The first does a remote application install...works fine. The second configures the installation for specific use...works fine.

    Instead of having two batch files I wanted to just have one to do the whole thing.

    I tried SLEEP 180 to hold the window for 3 minutes while the set up file ran, but it appears that it ignores this command and runs straight into my configuration routine. Is this because I am running an install from outside the DOS window? or am I missing something. BTW I am doing this in Windows XP
    Jerry

  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: BAT file sleep

    Anything in this thread help?

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: BAT file sleep

    Thanks Leif

    I used John Grays idea of:

    ping -n 46 127.0.0.1 >NUL

    This particular method pings 127.0.0.1 45 times

    I timed my installation and then added this line twice to get a total 135 seconds, this will allow me to adjust the time as I see fit if problems with the network in future
    Jerry

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: BAT file sleep

    Just to put closure I have used

    PAUSE between the two, no need for times or pings. It just reads Press Any Key to continue....

    excellent
    Jerry

  5. #5
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: BAT file sleep

    Jerry, for whatever the future holds, you might want to take a look at: AutoIt v3 - Automate and Script Windows Tasks - For Free!

    It's been mentioned here in The Lounge several times and I use it occasionally myself although I've downloaded but not used Version 3. It's got some pretty powerful scripting commands.

  6. #6
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: BAT file sleep

    Now that looks interesting...I shall download it at work tomorrow and have a play <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Jerry

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

    Re: BAT file sleep

    If you wanted a more sophisticated BATch file you could CALL START the Setup task, and look in the process list every five or ten seconds to check it was still present. When it had completed and gone, you would just carry on with the remainder of the BATch file. There are elements of this mechanism in my recent post on <!post=Broadband Speed Test,537176>Broadband Speed Test<!/post>...

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

    Ita, esto, quidcumque...

  8. #8
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: BAT file sleep

    Hi John

    Thanks for this, I have copied it across to my work PC for future reference. I tried out the PAUSE command today on a live application install across the network and viewing via VNC and it work a treat for my specific problem, but your snippets will be useful for a similar but more convoluted exercise I have to undertake
    Jerry

Posting Permissions

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