
Re: Changing the PAUSE prompt
That is an interesting simplification - the <nul is not required. Also the quotes are not needed unless the message contains special characters. But the &echo( should be preserved so that the cursor moves to the next line properly.
Code:
pause>nul|set/p=[message]&echo(
This seems a good candidate for a macro
Code:
@echo off
:: Define a PAUSE macro that properly handles arrow and function key presses
:: and also allows a custom pause message
set pause=for %%n in (1 2) do if %%n==2 (for /f "eol= tokens=*" %%a in ("!args!") do (endlocal^&pause^>nul^|set/p=%%a^&echo()) else setlocal enableDelayedExpansion^&set args=
:: Demonstrate usage of the PAUSE macro
echo Part 1
%pause% Press any key to continue . . .
echo Part 2
%pause% Custom pause message . . .
echo Part 3
Dave Benham