This is sort of a dumb question, but is it possible to modify the PAUSE prompt witout creating a new line under the new prompt? I am aware of the
Code: Select all
ECHO [message]
PAUSE > NUL
Moderator: DosItHelp
Code: Select all
ECHO [message]
PAUSE > NUL
Code: Select all
pause>nul|set /p "=[message]"<nul&echo(
Works perfectly! Thanks! I figured I needed to include SET /P in there somewhere, but I wasn't sure how. I just have one question: what does the < character do? I know > and >> are used for redirection. Is < used for feedback or something?aGerman wrote:It's possible even if it looks a bit oddCode: Select all
pause>nul|set /p "=[message]"<nul&echo(
The "echo(" let the cursor jump to the next line after you hit a key.
Regards
aGerman
Code: Select all
SET /P =[message]< NUL
PAUSE > NUL
Code: Select all
pause>nul|set/p=[message]&echo(
Code: Select all
@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