We help IT Professionals succeed at work.

How to copy folders/files between computers and preserve modified date ?

mirde
mirde asked
on
Hi,

I am looking to copy a bunch of Folders and Files within folders and would like to be able to preserve the date modified values.

They are currently on a Windows 2003 filesystem.

I have tried tools such as Winrar however it only seems to preserve file modified date and not folders, any folders that have files in them, the files are preserved but not the folders, they get reset, i would assume this is because files are being extracted into them.

Is there a way to preserve the folder modification/creation date as well?
Comment
Watch Question

Lee W, MVPTechnology and Business Process Advisor
Most Valuable Expert 2013

Commented:
Not sure... have you tried backup and restore (for example, NTBackup?)
I use Microsoft Rich Tools Richcopy to copy files to my backup drives but I do not compress or encrypt them.

If you do not need compression or encryption it should do the trick.

I hope this helps.

Sean Larabee

Commented:
Use xcopy in command prompt

I have a batch file containing the command scheduled to run every night.

it is

xcopy "D:\folder1" "C:\BACKUP\folder1" /E /C /I /H /R /K /O /Y
Commented:
Robocopy (Robust File Copy) would do this.  Robocopy is the Microsoft tool for copying files and preserving anything you want including file permissions.  You can read about it here:
http://en.wikipedia.org/wiki/Robocopy

This would be the ultimate copy command to copy all data from c:\foo to c:\bar:

robocopy C:\foo C:\bar /COPYALL /E /R:0 /DCOPY:T

Author

Commented:
tcomp, i tried your suggestion..

xcopy "C:\_testx" "C:\_xtest" /E /C /I /H /R /K /O /Y

But the folder time-stamp resets to your current time if there are files in it, I am trying to avoid this.

Going to try RichCopy.
Lee W, MVPTechnology and Business Process Advisor
Most Valuable Expert 2013

Commented:
Is there a reason you don't want to try NTBackup?  It's included, it's free, its even installed.

Author

Commented:
Trying to use a CLI command.

Just tried: robocopy C:\foo C:\bar /COPYALL /E /R:0 /DCOPY:T

And it worked, thank you.

Author

Commented:
robocopy C:\foo C:\bar /COPYALL /E /R:0 /DCOPY:T