Monday, 7 January 2013

Robocopy copy date/time of folders

I use Robocopy for some of my backups (here). I hadn't realised that Robocopy doesn't copy the modified date/time of any folders it copies. This isn't a huge problem but I like to sort some of my files so I can see newly created folders. 

The simple fix is to add the 'copy directory timestamps' switch to the command. 
/DCOPY:T :: COPY Directory Timestamps. 

So the command
ROBOCOPY Q:\HarjHome M:\HarjHome /MIR /R:0 

changes to
ROBOCOPY Q:\HarjHome M:\HarjHome /MIR /R:0 /DCOPY:T

and all the timestamps on the copied folders are copied too.  There is a minor overhead in this but it's negligible.

No comments:

Post a Comment