Home > other >  Bat file read TXT and assigned to a variable
Bat file read TXT and assigned to a variable

Time:03-23

Windows system, local E dish has a 1. TXT file, the content has two lines, the first line: lujing=D: \ test the second line: IP=121.21.42.123 wrote a bat, behind to read out the equality of values, and assigned to the variable, then the combined through variables answer the path to the directory of the folder to the appropriate place, as follows, but not copy always C disk directory file
echo off
For/f "tokens=1, 2 delims==" % % I in (1. TXT) do (
If/I "% % I"=="lujing (
"The set/a prompt=% % j
Xcopy/y/s/e/r/I prompt % % \ *. * e: \ test
)
)
The echo on

CodePudding user response:

% % j? It is wrong or is, I ask,,,
  • Related