I'm trying to make a little 'game' through batch, and need to get an input from the user and use that, but I need to get a variable (through set /p or something like it) and then clear the line/hide the output (as it usually just outputs whatever you entered). I can't use CLS however, as the other lines need to stay there. I do, however, want to be able to see what you're typing.
I tried many things I found on here that clear lines, like
@echo off
setlocal enableDelayedExpansion
:: Define CR to contain a carriage return (0x0D)
for /f %%A in ('copy /Z "%~dpf0" nul') do set "CR=%%A"
<nul set/p"=test!CR!"
pause >nul
pause
but that only does something like echo, I can't use it to get a variable.
I need something like this:
@echo off
set /p variable1=
[clear line]
echo %variable1%
pause