Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Hello all, I have a similar issue to this post http://superuser.com/questions/180573/move-files-from-multiple-folders-all-into-parent-directory-with-command-prompt-w

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

share|improve this question

marked as duplicate by Sathya, random Oct 4 '10 at 4:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
You say "bash" in your title. Do you have Bash available to be used to accomplish this task? –  Dennis Williamson Oct 3 '10 at 6:37
    
Sorry meant batch –  jon3laze Oct 3 '10 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. –  Camilo Martin Dec 27 '10 at 21:57

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.