Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment
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
add comment

Your Answer

 
discard

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.