When I try iterating the folders with a for each approach I have no access to the current index and I've also failed to manually keep one:
@echo off
set "i=0"
set folders='dir /b /ad'
for /f "eol=: delims=" %%D in (%folders%) do (
:: echo %%D
echo %i%
set /a "i+=1"
)
When I try iterating with a fori approach based on this example I can't even get it working:
@echo off
cls
set "i=0"
:SymLoop
set folders='dir /b /ad'
if defined folders[%i%] (
echo %%folders[%i%]%%
set /a "i+=1"
GOTO :SymLoop
)
I'm aware of my total lack of knowledge on the topic so I'd appreciate any kind of correction and/or advice.