Robocopy is not overwriting time stamps on target

I'm trying to run robocopy as a batch file on Windows 7, such that time stamps on the target will be overwritten if the source time stamps differ.  This seems to be working for directory time stamps but not file time stamps.  Could you correct my code, or advise me how to attain the intended result?

Echo Off
Echo. -------- Copying Files  --------
"C:\Windows\System32\robocopy.exe" [source]  [target] /b /e /copyall /mir /dcopy:T > "V:\My Documents\Computer\robocopy.log"
Echo. ---------- Copy Completed ------------
exit
ddantesAsked:
Who is Participating?
 
Steven HarrisConnect With a Mentor PresidentCommented:
/DCOPY:T : Copy Directory Timestamps.  This will not update files.

/COPYALL : Copy ALL file info (equivalent to /COPY:DATSOU).

/TIMFIX : FIX file TIMes on all files, even skipped files.

You should be looking into /copyall or /timfix
0
 
ButlerTechnologyCommented:
I think that your /CopyAll attribute is missing the T flag.
/copyall:T

Open in new window

Tom
0
 
ddantesAuthor Commented:
Thank you.   Will this flag also work?   /TIMFIX
0
 
ButlerTechnologyCommented:
I think that one would be better.
Tom
0
 
ddantesAuthor Commented:
Thanks to both Experts.  I couldn't award points for the first answer, because copyall:T returned an "invalid parameter" error in the log file.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.