Results 1 to 4 of 4
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: PAUSEing a batch file (WinXP SR3)

    Text that resembles % followed by a (hexadecimal) number may have a special meaning to HTML. To force % to be interpreted as a literal character even if followed by a number, enclose % in square brackets.

    So if you type <!t>[%]<!/t>1 in a message, it will be displayed as %1 when posted instead of messing up the formatting of the post.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PAUSEing a batch file (WinXP SR3)

    <P ID="edit" class=small>(Edited by chrisgreaves on 16-Oct-08 17:40. [Post: 738,066] (Percent signs) Thanks Hans!)</P>... speaking of paws ...
    <pre> set Pause=Pause

    ::
    :: Mount the external drives
    ::
    if "%Computername%"=="%Server%" call %Home%Mount.BAT
    %pause%
    ::
    :: Wait until the backup drive is mounted
    ::
    :: call %Home%WaitSet %WaitTime% ēckup%
    Call Waitmap %Waittime% X %Server%X
    Call Waitmap %Waittime% Y %Server%Y
    %pause%
    etc. etc. </pre>


    I decided to "SET PAUSE=PAUSE" while I'm debugging, and to "SET PAUSE=" for production.

  3. #3
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,420
    Thanks
    33
    Thanked 195 Times in 175 Posts

    Re: PAUSEing a batch file (WinXP SR3)

    Another technique might be to use a parameter to the BATch file to define some form of action, or not. That means you don't need to change the BATch file, just how you call it.

    As in <pre>if /i .%1==.paws PAUSE</pre>

    Obviously the %1 parameter may need changing to %3, or whatever is appropriate.
    BATcher

    Time prevents everything happening all at once...

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PAUSEing a batch file (WinXP SR3)

    >use a parameter to the BATch file to define some form of action,
    Quite so.
    I have also employed this as a debugging technique,
    although it worked better when machines were slower and we could actually READ what was echoed.
    <pre>REM XPShutDown.BAT Christopher Greaves Thursday Dec 9th 2004
    if "%debug%"=="" set debug=off
    @echo %debug%

    call c:batBackupPersonal.bat
    call c:batBackupGreaves.bat
    ShutDown.exe -s -f -t 01
    REM End of XPShutDown.BAT </pre>


Posting Permissions

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