Robocopy: Create Duplicate Copy With File Permissions [Re-run capable]

Paulsef
1 min readNov 15, 2019

If you are looking to create an exact duplicate copy of data with Windows Robocopy and want to use the same command to copy delta changes (including deletes from the source).

robocopy C:\Source D:\Destination /TEE /MIR /copyall /zb /w:1 /r:2 /xo

This command will copy the source folder specified to the destination and create the folder if it doesn’t exist. This command will also copy all permissions from the source to the destination.

After the command is done running you can simply run the same command again and it will copy any files that it missed because they were open or any new files that were added since the last run.

Any files that were deleted off the source from the last run will also be deleted at the new destination when the command is executed again.

If you are using a version of robocopy that supports multi-threading you can throw /MT on the end of the command. By default it will use 8 threads.

--

--

Paulsef

IT Infrastructure & Automation Geek by day. Information Security & Pentesting by night.