Answer the question
In order to leave comments, you need to log in
Why is the variable behaving so strangely in the for loop?
Hello!
The variable in a script behaves strangely. There is a file in which the paths to the files are entered line by line:
"d:\test\file1.txt"
"d:\test\file2.txt"
"d:\test\file3.txt"
SetLocal EnableDelayedExpansion
FOR /F %%i IN (d:\test\tmp.txt) DO (
SET str=%%i
SET str=!str:~2,-1!
echo %str%
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question