robocopy with DCOPY:T does not work

2

1

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.

user225935

Posted 2013-05-22T02:18:43.210

Reputation: 21

I believe I experienced this behavior when using the /MT switch. – AMissico – 2017-07-25T00:57:41.540

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 – 2013-05-22T03:17:51.677

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 – 2013-05-22T09:53:31.280

Answers

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.

Kevin Fegan

Posted 2013-05-22T02:18:43.210

Reputation: 4 077

0

I was able to track this back to a version problem. On my Windows 7 workstation I have a robocopy 5.1.10.1027 which does not support the /dcopy switch. On my Windows Server 2012 the version is 6.3.9600.16384 and it does support /dcopy. It looks like you will still have to run two different commands.

Ben Mendes

Posted 2013-05-22T02:18:43.210

Reputation: 9

to check the version you need to right click on robocopy.exe in windows/system32 and check the properties/details tab – sdjuan – 2015-06-10T18:29:00.810