Hi there.. If I type the following
pause
it displays
Press any key to continue
it shows this along the left edge of the screen.... How do get it to display say in mid screen.?
Similarly for this
set /p input=Choice:
the word choice: is on left of screen, how do I get it in mid screen?
Thanks
placing text on screen
Moderator: DosItHelp
Re: placing text on screen
The SET /P command consumes all white space at the beginning of the prompt string. So you have to trick it.
Code: Select all
@echo off
:: Define BS to contain a backspace
for /f %%a in ('"prompt $H&for %%b in (1) do rem"') do set "BS=%%a"
set /p "input=x%BS% Choice:"
echo %input%
pause
Re: placing text on screen
And now we can use a little more trickery to get your desired result for the pause command.
Code: Select all
@echo off
:: Define BS to contain a backspace
for /f %%a in ('"prompt $H&for %%b in (1) do rem"') do set "BS=%%a"
set /p ".=x%BS% x%BS%"<nul&pause
echo.
echo. After Pause
pause