10927Views16Replies

Author Options:

Batch pause command Answered

I was just wondering if there was a way to customize the message in a batch file to say something other then "press any key to continue....." or hiding the message with ">nul" thanks Batchers Unite!!!

Discussions

0
user
spiker

9 years ago

So what would the command line look like? Choice pause "HAHAHAHHAA this has been paused!!!" ?

what does that have to do with the pause command? i want when i have pause come up, it say a different message that i can customize.

I believe it halts execution IIRC displaying the message you wish to have displayed.

Well tahnks everyone for the help, i have found that it is impossible, i have found a new way to display a message. Thanks all! @echo off echo. echo hi echo. pause echo. echo and bye echo. echo Press any key to advance the rest of this file.... pause >nul The above has accomplished my desire for a custom Pause message. test it out!!!

@ echo Your message here

@ pause>nul

try it

. You cannot customize the text that PAUSE displays ("what you see is what you get" - Geraldine), but you can with CHOICE.

does anybody have any examples? i would liek to see it in action plz

. All you have to do is follow the link that Goodhart provided.

. Try searching for something like "choice +batch".

this will work..

@ echo Your message here

@ pause>nul

Try this, it's not actually changing the pause message but it looks like it...

echo INSERT MESSAGE HERE
pause > nul

This will display:

INSERT MESSAGE HERE

Until you press a key that is what it will display

what a bunch of ignorant people! CHOICE doesn't work on WinXP (or earlier NT-based OSes). and you could've at least posted what CHOICE DOES, and how to use it (the link wasn't very descriptive, and didn't reference how to use it the way the OP was wanting to.

in order to run the script on ANY PC, you would need to use something like:
2>nul (pause|set /p
or

2>nul (pause|echo+Your message)

if you would prefer the cursor blinking on the next line...

of course, this works best if you preface it with a good old @echo OFF, but both will work either way.

As Nacho says, the "Choice" cmd will stop the execution until a displayed Choice is made.