10

How to copy files while not modifying the file creation times at all? Just like the cut and paste works: it doesn't modify the file creation times at all.

Where to get such a program? I don't want to lose the info when my files were created, and I don't want to cut/paste the files on my new HDD since I want to leave a backup on this old disk in case the new one will fail.

Also this program should not stop the copying if there occurs some error like "are you sure you want to copy a read-only file?" or something like that.

Glorfindel
  • 4,099

5 Answers5

5

Robocopy preserves timestamps by default. You can get it for XP in the Windows Server 2003 Resource Kit.

example:

robocopy C:\ E:\ /E

If you aren't comfortable with the command line, Robocopy GUI makes it even easier.

Another copy utility which can preserve timestamps is XXCOPY:

alt text

Gareth
  • 18,809
  • could you tell me why does this beep once in a while when i use "robocopy C:\foo C:\bar /COPYALL /E /R:0" command? it occurs once in 10mins or something. –  Feb 16 '10 at 11:53
  • Not sure, robocopy has never beeped for me. Are the files being copied properly though? –  Feb 16 '10 at 15:08
  • Dunno, the size of the copied data is few megabytes smaller. Ive gotta write some file checker program so i can see which files were not copied... –  Feb 17 '10 at 10:22
4

Zip the files. Then extract the .zip to the destination. Seriously.

Windows Explorer doesn't offer any "Paste Special" menu option, so you only have the normal paste behavior.

I'd like to think there may be a shell extension written by someone somewhere, which could add a "Paste with creation times" menu option, but I've not found one.

njd
  • 11,206
1

I've been happily using FreeFileSync to back up selected folders without realizing its usefulness in preserving the date information during a copy. The first test was to move the memory card from my Canon camera to my laptop PC and perform a Synchronize with the Mirror setting. The second test was with the memory card in the camera. Both tests resulted in files copied with the original datestamp. Correction: Copying from the camera does not work properly. Caution: I tried to update FreeFileSync and was blocked by my malware detection program Malwarebytes. Tried again but this time clicked Download FreeFileSync 10.4 Windows Setup. I don't know what I clicked before but this time FreeFileSync downloaded and installed without messages or blocks from Malwarebytes.

JZC
  • 11
1

Today, I discovered a very interesting and strange way to do this without using third party software.

  1. Copy a file, say foo.bar with the creation date of yesterday.
  2. Paste it in the same folder. As usual, the copied file foo - Copy.bar will have the creation date of today.
  3. Rename the original file foo.bar to something else, say foo-.bar.
  4. Rename the copied file foo - Copy.bar to foo.bar.

The copied file's creation date will then immediately change to that of the original file, i.e. yesterday. The original file's creation date will of course remain same. After that, you can rename, move, cut-and-paste, etc.; the creation dates of both files will be preserved as the old creation date. You will have successfully duplicated the original file with the same date attributes.

If you wanted to copy the file to a different folder, rather than duplicating a file inside the folder, that can naturally be added as the fifth step by moving the file; but replacing the third step as follows

  1. Move (cut-and-paste) the original file foo.bar to the desired copy location.

with the fourth step unchanged also seem to work.

I have no idea why this works or if it is intended behavior. I initially thought it is because of some software or customization that I have, so I tested it on another computer with little customization and it again worked. I also tried it on a FAT32 USB flash drive, and it again worked, so it is not a quirk of NTFS as I initially suspected.

Still, confirmation from other people about if it works on their systems would be useful. I tested it on Windows 10 20H2 systems. If it indeed works the same for everyone, I would love to see some documentation or explanation for this feature.

  • 1
    For anyone who cares to know what's behind this, it's called "file system tunneling" which goes back to NT (emulating a DOS thing) and I didn't even know it existed until yesterday when I was trying to figure out a problem with file times not updating. Here's a related question describing it. – GuitarPicker Jun 27 '23 at 20:10
  • @GuitarPicker thanks, I was very curious why this worked; Raymond Chen has a nice explanation, as always. So it looks like you have 15 seconds to do this and preserve creation times, according to the other link in that answer. – Debie Downer Aug 24 '23 at 14:49
0

FreeFileSync (https://www.freefilesync.org) use the Mirror setting. It preserves creation timestamps and won't hang on an error. Does a lot more but should solve this problem.

gt7599a
  • 31
  • 1
  • 7