im quite new to cmd-scripts and i encountered a problem.
i want to iterate through all files in the current folder and all its subfolders having certain endings that are stored in the array %list%
. so i started with:
@for /R %%d in (.) do @(
cd %%d
@(for %%a in (%list%) do @(
for %%f in (*.%%a) do @echo %%d/%%f
))
)
this works however it produces paths like C:\test\.\myfile.txt so i want to get a substring of the dir. since this does not work on variables like %%d, i tried to store %%d in a seperate variable:
@for /R %%d in (.) do @(
cd %%d
set dir=%%d
@(for %%a in (%list%) do @(
for %%f in (*.%%a) do @echo %dir%/%%f
))
)
but this gives me the same output as @echo /%%f
what am i doing wrong?