1

Possible Duplicate:
merging all files into one folder from different folders

Hello all, I have a similar issue to this post Move files from multiple folders all into parent directory with command prompt

However I have an image directory with multiple sub-directories, I'd like to move all images from the sub-directories to the root directory.

F:\Pictures\100KC1
F:\Pictures\100KG2
F:\Pictures\100LF1

and I'd like to move all the images from each sub to

F:\Pictures\

System is Win7 64-bit, I'd prefer doing it command line or batch script but if there is an app I'd accept that as well. Thanks

3
  • You say "bash" in your title. Do you have Bash available to be used to accomplish this task? Oct 3, 2010 at 6:37
  • Sorry meant batch
    – jon3laze
    Oct 3, 2010 at 8:22
  • You may want to check my answer to the other question. I've made an application that does this, and it handles unexpected situations too, plus shows stats, and has some command-line niceties. Dec 27, 2010 at 21:57

1 Answer 1

1

Took me like 3 seconds to Google this:

http://www.computerhope.com/xcopyhlp.htm

You would write your .bat file like this:

xcopy f:\Pictures\100KC1 f:\Pictures /y /e
xcopy f:\Pictures\100KG2 f:\Pictures /y /e
xcopy f:\Pictures\100LF1 f:\Pictures /y /e
exit

This will also copy any directories in your source directories to your destination directory.

If you want to use the command line just use && between each xcopy statement like this:

 xcopy f:\Pictures\100KC1 f:\Pictures /y /e && xcopy f:\Pictures\100KG2 f:\Pictures /y /e && xcopy f:\Pictures\100LF1 f:\Pictures /y /e

Results will be the same.

Not the answer you're looking for? Browse other questions tagged .