Using the /p
switch with the SET
command you can define variables from an Input.
This input can be a user Input (keyboard) :
echo Enter your name :
set /p name=
echo Your name is %name%
Which can be simplified like this :
set /p name=Enter your name :
echo Your name is %name%
Or you can get the input from a file :
set /p name=< file.txt
in this case you'll get the value of the first line from file.txt
Getting the value of various line in a file :
(
set /p line1=
set /p line2=
set /p line3=
) < file.txt