Robocopy – Change Modified Date

robocopy

I'm copying a file over to another directory and was wondering if Robocopy can change the modified date to the date it copied the file over in the new directory. I haven't been successful playing with the switches.

Set Source="C:\Dir\
Set Dest="C:\Dir\TMP

robocopy /V /IS "%Source%" "%Dest%" /NOCOPY

I want test.txt (modified 01/23/12) to copy over to the TMP directory with a new date modified of time of copy.

Best Answer

Nope. You can do this with a powershell script though. Just Google powershell change last modified date. So you can use Robocopy to copy the files and then run the powershell script to modify the date. Or you could use powershell to copy the files and modify the date.

Related Topic