Here is some code I made 🙂
@echo off
set source=”R:\Contracts\”
set destination=”R:\Contracts\Sites\”
ROBOCOPY %source% %destination% *.srt *.pdf *.mp4 *.jpg /COPYALL /R:0 /S
for /r %source in (*) do @copy “%destination” .
R:\Contracts\ is full of folders which have files in them.
I want to copy all to R:\Contracts\Sites\ and flatten the folder structure.
Everything copies well but also the folder structure.
Thank you
This works……
@echo on
set source=”C:\folders”
set destination=”C:\folder2″
for /r %source% %%F in (.) do if “%%~fF” neq %destination% ROBOCOPY %%F %destination% *.srt *.pdf *.mp4 *.jpg *.txt /COPYALL /R:0