Hoy averiguando me encontré con esto en stackoverlfow:
files in current dir:
for %f in (.\*) do @echo %f
subdirs in current dir:
for /D %s in (.\*) do @echo %s
files in current and all subdirs:
for /R %f in (.\*) do @echo %f
subdirs in current and all subdirs:
for /R /D %s in (.\*) do @echo %s
Fuentes:
http://stackoverflow.com/questions/138497/iterate-all-files-in-a-directory-using-a-for-loop
Batch Leer en un directorio archivos o carpetas