Robocopy – Copying files with file permissions (ACLs) and Importing file permissions / security information

If you have a file server in your corporate environment and want to move all files to another location with all security information / file permissions  (ACLs), you can use robocopy, a built-in tool which can be called simply from a command prompt of a Windows Server 2008 or Windows 7 installed computer.

If you want to copy all the files into the new file server by keeping directory tree as it is and security information / file permissions, you can simply use the following command to achieve that;

robocopy “source address” “destination address” *.* /mir /sec

If you have copied the files before with another tool or technique but without any file permissions or security information (ACLs), you can fix the security information of each file and add file permissions using the following command;

robocopy “source address” “destination address” *.* /mir /secfix /sec

Using the command above, you don’t need to copy all files again or try to write a script to add access control list to each file, robocopy will read the file permissions from the existing directory tree and add the security information to each file in the new location.

This entry was posted in Windows Security and tagged , , , , , , , , , . Bookmark the permalink.

3 Responses to Robocopy – Copying files with file permissions (ACLs) and Importing file permissions / security information

  1. Francis Soen says:

    Your article is the first one that shows how to use the /secfix flag properly. All other articles mention /secfix but not /sec and I always ended up with an error message.

  2. Chien Nguyen says:

    Francis Soen is correct. Microsoft website even suggested about using /xc, …. BUT it does not works.


  3. Kartik says:

    Thats the problem with Robocopy, its buggy. I have also used this software but after sometime I switched to a more reliable and efficient software called GS Richcopy 360 which uses 100% multi threaded multi transfer. Its the best that I have used so far. I have witnessed the transfer speed, it is really great and far better than Robocopy. You can command GS RichCopy 360 what files to copy, how to manage open or locked files, copy and retain NTFS permissions and preserve date and time stamp information.

Leave a Reply

Your email address will not be published. Required fields are marked *