0

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.

Rowell
  • 703
  • 8
  • 18
  • 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

2 Answers2

1

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.

murisonc
  • 2,968
  • 2
  • 20
  • 30
0

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.

Rowell
  • 703
  • 8
  • 18