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

Hi Pros.. o)

I had a quick look into the manual, looking up the "SetAttr" command and stuff, searched the forum, but did not
find a way to actually get a created/modified timestamp from a single file and copy it over to another file or various files.

Can it be done ?!

Ciao & thanks in advance.. o)

The forum puts this thread high up the search results for related queries, so I'll add links here for people who find it:

You could use either of these:

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