Solved

Copy files from subfolders to one folder with no subfolders

Posted on 2011-03-03
4
1,722 Views
Last Modified: 2012-08-14
Hello,

I need to create a batch file to copy files from a folder with subfolders and place them in a destination folder without the entire tree struction.

I have tried XCOPY but it copies the entire structure.  I didn't see any of the swtiches to remove the subfolders.

Thanks so much!!!
0
Comment
Question by:NancyCPS
4 Comments
 
LVL 14

Accepted Solution

by:
John-Charles-Herzberg earned 500 total points
ID: 35027262
0
 
LVL 38

Expert Comment

by:Aaron Tomosky
ID: 35027272
Robocopy.
0
 
LVL 8

Expert Comment

by:subhashchy
ID: 35027296

for /f %a in ('dir /s /b') do move %a c:\test\

try this..

Note that if duplicates found it will not overrite

0
 
LVL 1

Author Closing Comment

by:NancyCPS
ID: 35027435
Thanks soooooooooo much.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question