I need to copy all files of a directory and all of its subdirectories to a specified location. However I don't want the folders. I just want all the files. Basically trying to flatten out a structure.
Source Dir: C:\users\darcy\Music
Target Dir: C:\Music
Can I use xcopy? I can't use robocopy as it's a work computer....
Microsoft DOSWindows BatchVB Script
Last Comment
LeeeRussell
8/22/2022 - Mon
AustinComputerLabs
Are you saying you do not want any of the folders inside of the music dir, just all of the files dumped into a single directory?
fireline1082
I do not think u can do (files and subs) using xcopy.
But u can do it using VHS script where u need to loop through the folders and copy the files.
I have similar script to delete files (not copy). I will pass it to you tomorrow when I reach the office.
Copy should be similar.
ragnarok89
I don't think this is possible with xcopy.
You could just create a batch file to do this, or try xxcopy
C:\Temp>call music.bat > sam.log
\Users\Darcy\Music"') do @copy "\MusicFiles" was unexpected at this time.
elwayisgod
ASKER
Rick,
If i just run what you said and not put it in a .bat file and then call it, it works.. however there are duplicates and it stops and asks me to overwrite or not... Is there a parameter I can put in so it automatically overwrites?