I have a directory with several subdirectories with files.
How can I copy all files in the subdirectories to a new location?
Edit: I do not want to copy the directories, just the files...
As this is still on XP, I chose the below solution:
for /D %S IN ("src\*.*") DO @COPY "%S\" "dest\"
Thanks!
Use the Copy Command to Transfer Specific Files Right-click the Start button and choose "Command Prompt (Admin)" to open CMD. To copy files, use the copy command from the command line. copy c:\myfile.
The Xcopy command should help here.
XCOPY /E SrcDir\*.* DestDir\
Or if you don't want any of the files in SrcDir, just the sub directories, you can use XCOPY in conjunction with the FOR command:
FOR /D %s IN (SrcDir\*) DO @XCOPY /E %s DestDir\%~ns\
robocopy "c:\source" "c:\destination" /E
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With