Wednesday, 26 February 2014

Robocopy: Copy Directory Structure Preserving Date Modified

Use robocopy to copy a directory structure and preserve the date modified of directories:

robocopy "source" "destination" /B /E /COPYALL /DCOPY:T


robocopy "D:\Data" "E:\Data" /B /E /COPYALL /DCOPY:T
/B :: copy files in Backup mode.
/E :: copy subdirectories, including Empty ones.

/COPYALL :: COPY ALL file info.
/DCOPY:T :: COPY Directory Timestamps.

1 comment:

  1. it didn't worked every time in robocopy so I had to stop using it, it gave erros which were hard to solve. Now I am using GS Richcopy 360 which provides this feature and using it I can automate this task also. Give it a try, thank me later.