How to copy modified-timestamp from one file to another?

robocopy.exe (somehwere in your windows folder right now), is another option.

There is the /COPY switch for files on robocopy.exe (and /DCOPY for folders), which allow you to specify what is to be copied (timestamps, data, attributes or only security settings e.g..

For timestamps on files and folders only, run robocopy.exe like this:
robocopy.exe <srcpath> <dstpath> /COPY:T /DCOPY:T

This is surely the better option for heavier copy/sync timestamp jobs with larger folder structures. You can make robocopy.exe skip junctions and links with /XJD /XJF. No way to copy modified/created separately though. Run Robocopy.exe /? to take a look at all the other valuable copy/sync/mirror options.

1 Like