set /p question...
Posted: 30 Apr 2017 13:18
this is the batch (inspired by one of the posts by Aacini)...
this is the result (win xp sp2)...
how comes that the variable %_line% vanishes outside the brackets?
how can i retain it outside the brackets (beside echoing it to a file)?
_
Code: Select all
@echo off
setlocal disabledelayedexpansion
echo(test | (set /P "_line=" & set _)
set _
endlocal
pause
this is the result (win xp sp2)...
Code: Select all
_line=test
Environment variable _ not defined
Press any key to continue . . .
how comes that the variable %_line% vanishes outside the brackets?
how can i retain it outside the brackets (beside echoing it to a file)?
_