Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using Windows 7. The robocopy switch DCOPY:T can be used (I mean there is no parameter error) in the command

robocopy C:\TEST F:\test /E /MIR /COPYALL /DCOPY:T

However, folder timestamps are not preserved except for folders that do not have more folders under it, i.e., all folders that have subfolders under them are not getting timestamps preserved. What is going on here?

I ran the command with elevated privileges.

share|improve this question
    
I later on tried /copy:t first, which only copies the directory tree with the original time stamp. and then /copyall, this time all data are copy with original time stamp into those folders that have correct time stamp. So it is OK now. But still, I am confused why /copyall at the first place does not work, why bother to do this two-step copy. –  user225935 May 22 '13 at 3:17
    
You are probably aware of this... I noticed your option switches use the wrong type of slash (backslash). You wrote it like this: robocopy C:\TEST F:\test \E \MIR \COPYALL \DCOPY:T, it should be like this: robocopy C:\TEST F:\test /E /MIR /COPYALL /DCOPY:T –  Kevin Fegan May 22 '13 at 9:53

1 Answer 1

I recall seeing the issue you described (or something similar) while using a previous version of Robocopy.exe (it could have also been on Windows XP rather than my current Windows 7).

This behavior was by design, or at least as expected.

The issue is caused by the fact that the files and folders (and timestamps) are copied as they are encountered while traveling down the directory tree.

For any particular folder, lets call it Folder "A":

  • First, folder A is created (and apparently child files if any), and then the Timestamp is set to the same as the Source folder.
  • If folder A has no child folders, Robocopy continues with the next Sibling of folder A, or back in the Parent of folder A. The Timestamp for folder A remains correctly set.
  • If folder A has child folders, they are then created in folder A, which will cause the timestamp of folder A to be modified.

The result (if A has Child folders) is, that the first time through, the timestamp for A will be wrong. The next time through, no new child folders are created, so the Timestamp for A remains correct.

As I said, I am currently using Robocopy Version 5.1.10.1027 (XP027), on Windows 7 Home Premium x64. When I try this operation you have described, I find that all the folders (empty or not) have correct timestamps after the first pass, so a second pass is not necessary. Probably, that means that this newer version of Robocopy (XP027) waits until all child files/folders have been completed within a folder before copying the timestamp for that folder.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.