Here is a quick batch file that will go through all subdirectories in a directory tree and copy files, ie photos, to another directory. This works well with the Saving Vox photos post that I did recently.
for /f %%a in (‘dir /b *_files’) do call :process “%%a” “%%~dpa”
copy *.jpg c:\TARGETDIR
The main points in this are the “_files in the dir command and the C:\TARGETDIR in the copy command. In my example case, Firefox and iMacros created a bunch of directories called (something)_files, so I want to loop through all of those. The batch starts by building a list of all of these directory names then it starts a loop process to work through them.
The subroutine “process” changes the current directory to the subdirectory and then copies all of the JPG (picture) files up to C:\TARGETDIR. You would call this something else, but make sure it’s created before you start.
Running instructions –
After making appropriate changes, you save this batch file in the parent directory of the subdirectories you want to read from. I call it something simple like “DOIT.BAT” and then I shell out to DOS and run it.
Again, this works for me – there are probably other ways to achieve the same results.