Copy Timestamp from file A to files B, C, D

Can anyone recommend a utility to copy "last modified" date from a single source file/folder to one or more target files/folders. A command line utility would be best but GUI driven would also be OK.

Regards, AB

Are you OK with downloading/installing the Cygwin utilities, to give yourself a *nix like command line environment?

Yes I am.

Regards, AB

Ok, then. Download and install Cygwin using its setup.exe installer. Then launch the bash shell and run the command:

find PathToFiles -print0 | xargs -0 touch -r FullPathToYourFile

where PathToFiles is the relative or full path to the files whose dates you want modified, and FullPathToYourFile is the full path to the file whose modified date you want to pull and use.

You can do this with DOpus in 2 steps:

1) Copy timestamp of selected source file to clipboard (Check line 6 for the correct path to dopusrt.exe):

Rename FILEINFO TO "{modifieddate|D#YYYYMMdd} {modifiedtime|T#HH,mm,ss}"

@script vbscript
Option Explicit
Dim strOpusHomePath
strOpusHomePath = "C:\Program Files\GPSoftware\Directory Opus\DOpusRT.exe"
Dim Shell
Dim Clip
Set Shell = CreateObject("WScript.Shell")
Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)
Clip = strNewName
strNewName = ""
Clip = Replace(Clip,"-",":") ' Set the clipboard via Opus.
Shell.Run """" & strOpusHomePath & """ /CMD Clipboard Set " & Clip,0,True
End Function

2) Apply timestamp to selected target files:

SetAttr MODIFIED "{clip}"

Thanks MrC and Kundal. Two very good suggestions.

I have implemented Kundal's code as a 3-button solution. For safety, I added @firstfileonly to the COPY button and @confirm to the PASTE button. Works like a charm.

Regards, AB

You can use ClipboardEx now for this:

Example:
ClipboardEx COPYTIMESTAMPS
ClipboardEx PASTETIMESTAMPS

It has full commandline support:
ClipboardEx COPYTIMESTAMPS FROM=C:\File01.txt TO=C:\File02.txt

Multiple files can be specified by separating them with ";".