Ok, so you know how when you type up pause
in CMD, it will say 'Press any key to continue...'. How do I change that to say something like 'Press a key to proceed...'?
Lastly, I was coding a batch file. I want to know what's up if I have something like:
@echo off
cls
pause
pause
pause
pause
It seems to skip round about to pauses When you press a key. I'm curious as to know the rules of which the pauses are skipped. Thanks.
Execution of a batch script can also be paused by pressing CTRL-S (or the Pause|Break key) on the keyboard, this also works for pausing a single command such as a long DIR /s listing. Pressing any key will resume the operation.
Nearly the same as Deniz Zoeteman, except this version displays the blinking cursor on the same line as your custom message, as does the normal PAUSE command. The Deniz Zoeteman solution displays the blinking cursor below your message.
<nul set /p "=Press a key to proceed..."
pause >nul
You cannot change the text displayed when a pause command is executed. It's bound to the Windows installation's language pack. The only thing you can do is not letting it say anything by doing pause>nul
.
Of course, there's different ways to simulate pause
; see the example from the other answer, where set /p
is used. With pause>nul
however, you can do this:
echo Custom pause message
pause>nul
And that should work.
And for pause commands skipping, that's most likely due to the key still being pressed down while the next pause command already executed (small guess though - I don't recall exactly if that's the behaviour of the command).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With