Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pause BCommand in Batch File

    Hello, I hope this is the right forum. My request is a bit pedantic, but does anyone know how to alter the position of the "Press any key to continue" dialogue when pausing a batch file? I have a batch file and I have some echoed statements. They show up 2 characters to the left of the batch file window but the "Press Any Key Command" appears flush next to the edge of the window. Is there anyway to get such automatically generated commands to indent a little. The batch file runes fine, this is purely for cosmetic purposes, and my peace of mind.

    Thanks,

    Chris (Hunt)

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Pause BCommand in Batch File

    You can fake the pause...

    <code>echo off
    echo Press some old key to continue...
    pause > nul</code>

    ... but I'm not sure about other commands.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pause BCommand in Batch File

    Thanks, that works very well. Pause is the only key I need.

    Best wishes,

    Chris

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

    Re: Pause Command in Batch File

    An alternative is to make use of the 'new' SET /P command as follows<pre> @set /p var= Please press any key you like</pre>

    Usually you would put double-quotes round the string, but that causes the initial blanks to be removed, and the text left-justified.
    BATcher

    Time prevents everything happening all at once...

Posting Permissions

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