How do I list only image files inside a folder? like jpg, gif, png, bmp This is the code I got so far. What it does is it makes a dirlist in each subfolder and lists all the files. Now I want to list only image files. How can you do it using windows cmd? @echo off for /r "C:\Documents and Settings\Administrator\Billy\Artworks\" %%d in (.) do dir /s/b "%%~fd" > "%%~dpnd\dirlist.txt" Code (markup):
Below will list image files alone... @echo off FOR /R "C:\Documents and Settings\Administrator\Billy\Artworks\" %%G IN (*.jpg,*.bmp,*.png,*.gif) do echo %%~fG >> %%~pG\dirlist.txt Code (markup): Hope it helps...