Batch file needed to combine all subdirectories to one

phone_tech

Honorable
Jan 2, 2013
1
0
10,510
0
I am need of help and saw some good ones on here but not specific to what i need to acomplish. I have a folder on my D:\ drive (clients) that contains around 3,000 or so other folders (client names). in those folders the files and folders can be completely random.

i am trying to create a batch file to take all of the subfolders and files that are in the individual client names folders and combine them all into one new folder within the client names folders.

Any help out there? i havn't done much with bat files other than for reporting file types of these same folders and also mapping network drives.

thanks,
J
 

Scott_D_Bowen

Honorable
Nov 28, 2012
50
0
10,590
1
Funnily enough because of a very old annoyance with PKZIP and PKUNZIP you can do just this.

Use PKZIP to ZIP each folder, inclusive of everything to a given location.
Then use PKUNZIP to extract the contents of the ZIP --- without preserving the folder (directory and sub-directory) hierarchy.

So long as you have the free space for each ZIP that gets created this is by far the easiest solution, as batch files don't really handle unknown folder names without some really funky capturing of those names and processing them using methods that, frankly, are more dangerous (by far) than what I've proposed.

 
Thread starter Similar threads Forum Replies Date
David___Only Apps General Discussion 0
S Apps General Discussion 4
M Apps General Discussion 3
D Apps General Discussion 2
N Apps General Discussion 1
NoctisLionward Apps General Discussion 2
malavena Apps General Discussion 3
Tom Waller Apps General Discussion 2
P Apps General Discussion 1
S Apps General Discussion 4
A Apps General Discussion 13
Z Apps General Discussion 1
P Apps General Discussion 7
deadmuse Apps General Discussion 1
J Apps General Discussion 1
A Apps General Discussion 1
C Apps General Discussion 1
W Apps General Discussion 4
R Apps General Discussion 1
P Apps General Discussion 5

ASK THE COMMUNITY