Solved

Robocopy is not overwriting time stamps on target

Posted on 2013-12-03
5
2,121 Views
Last Modified: 2013-12-03
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
0
Comment
Question by:ddantes
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:ButlerTechnology
ID: 39693889
I think that your /CopyAll attribute is missing the T flag.
/copyall:T

Open in new window

Tom
0
 

Author Comment

by:ddantes
ID: 39693897
Thank you.   Will this flag also work?   /TIMFIX
0
 
LVL 6

Expert Comment

by:ButlerTechnology
ID: 39693910
I think that one would be better.
Tom
0
 
LVL 18

Accepted Solution

by:
Steven Harris earned 250 total points
ID: 39693924
/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
 

Author Closing Comment

by:ddantes
ID: 39693957
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

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question