Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
A colleague pointed out that I can do this easily with a batch file: Echo %date% %time% > testfile.txt – Rowell Jan 25 '12 at 20:14

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.

share|improve this answer
up vote 0 down vote accepted

My solution was to use a batch file:

Echo %date% %time% > testfile.txt

That will include the date and time within the text file and also update the modified date to the file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.