I have encounter a problem in getting array value, the following is my code snippets:
setlocal enabledelayedexpansion
set arraynum=0
set count=0
set list[0]=1
For /R %cd%\ %%G IN (*) do (
set filenum=%%G
echo %%G
set list[!arraynum!]=!filenum!
set /a arraynum+=1
)
echo %arraynum%
echo %list%
echo %count%
echo %%list[%count%]%%
pause
the result value of %%list[%count%]%% is %list[0]%, not the value of filename, it's very strange and is there any way or any instruction to cover that, thanks a lot.