Solved

Robocopy is not overwriting time stamps on target

Posted on 2013-12-03
5
2,370 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

One of the features I've come to appreciate about Windows 7 and Windows Server 2008 R2 is the ability to pin applications to the task bar. As useful a feature as I've found this, it does have some quirks.  For example, have you ever tried pinning an…
While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

688 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