Reputation: 479
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"
Upvotes: 1
Views: 1346
Reputation: 175876
Simply add a file extension filter;
....works\" %%d in (*.gif;*.jpg;*.jpeg;*.png;*.bmp;*.tiff) do dir /s/b "% ...
Upvotes: 2