0

I have a dilemma. My friend has lots of photos in random folders in his computer, that he would like to back-up onto a flash drive. I was thinking a batch file would be the easiest way to go, assuming manually doing it is out of the question.

So, what could i do to copy ALL the files with a certain extension (in my case .jpg, .gif, and .png) in EVERY subfolder of a hard drive to a flash drive (the batch file would run off said flash drive)

If the batch file is good enough and it does not break stack overflow rules, i may pay a little via paypal to whoever answers :)

Primm
  • 1,347
  • 4
  • 19
  • 32
  • Was the Windows Search Assistant not able to find all files with a particular extension? – Ben Voigt Apr 13 '12 at 21:44
  • Are you trying to maintain directory structure? If not, what should be done in case of conflicting (duplicate) filenames? – Ben Voigt Apr 13 '12 at 21:45

1 Answers1

0

You can do directly from the command line without a batch:

for /r C:\ %x in (*.jpg *.png *.gif) do @copy /y %x .

This will overwrite files with the same name, though.

Joey
  • 344,408
  • 85
  • 689
  • 683