I want search in the text file and copy contents in value of variable my text file name is pass and that's content is only 123 i want var value be 123
set var=123
I want search in the text file and copy contents in value of variable my text file name is pass and that's content is only 123 i want var value be 123
set var=123
REM write to file:
(echo 123)>pass
REM read from file:
<pass set /p var=
REM display value:
echo %var%
this reads the first (or only) line of the file.