Change pause message

So, you know how when entering pause in CMD, it will say: "Press any key to continue ...". How to change this to say something like "Press a key to continue ..."?

Finally, I encoded a batch file. I want to know what will happen if I have something like:

 @echo off cls pause pause pause pause 

It seems that you are moving to pauses. When you press the key. I am curious to know the rules by which pauses are skipped. Thanks.

+6
source share
5 answers

In almost the same way as Deniz Zoeteman, with the exception of this version, a blinking cursor is displayed on the same line as your user message, as well as the usual PAUSE command. Deniz Zoeteman's solution displays a blinking cursor under your message.

 <nul set /p "=Press a key to proceed..." pause >nul 
+9
source

You cannot change the text displayed when the pause command is executed. It is associated with the Windows installation language pack. The only thing you can do is not let it say anything by doing pause>nul . Of course, there are different ways to model pause ; see an example from another answer where set /p . However, with pause>nul you can do this:

echo Custom pause message

pause>nul

And that should work.

And for skipping pause commands, which is most likely due to pressing a key while the next pause command is being executed (although a little guessing - I don’t remember exactly if this is the behavior of the command).

+7
source

You might want to try

 set /p=your message 

Note: you need to press the enter key to continue working against any key.

+1
source

Option number 1:

@echo off

echo Press any key to continue, or Ctrl-C to abort.

pause> nul

Option number 2

set / p = Press any key to continue or Ctrl-C to cancel.

- β†’ I prefer the screen output of option No. 1.

+1
source

This is one practical application:

set / p = Press ENTER to continue or Ctrl-C to cancel.

0
source

Source: https://habr.com/ru/post/949064/


All Articles