Solved

Robocopy is not overwriting time stamps on target

Posted on 2013-12-03
5
2,063 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

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…
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…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now