I want to read a text file and store each line in an array. When I used the code below, \"echo %i%\" is printing 0 every time and only array[
\"echo %i%\"
0
array[
Read set /? description about environment run-time linking. When you are using %i% inside for - it is pre-expanded before for execution. You need to use !i! instead.
set /?
%i%
for
!i!