Here is my working test:
set line=abc1234
set line2=%line:~0,3%
echo %line2%
pause
The expected output is: abc, and it is.
Here is the goal:
FOR /F "tokens=*" %%i IN (d:\rt.txt) DO (
set line=%%i
set line2=%line:~0,3%
echo %line2%
)
pause
When %%i is ==========================, the expected output is: ===
Instead, the output is:
D:\>(
set line===========================
set line2=~0,3
echo
)
ECHO is on.
How do I get the expected output?
(Eventually, I am going to replace Echo with an If statement, but I want to make sure it is working first.)



Back to top







