Using xcopy to copy files and folders and keeping the ntfs permissions

Overview

Xcopy while still included in Windows 10, XCOPY has been deprecated in favor of robocopy. XCOPY it has some great switches for doing things such as verifying the copy and only coping file that are newer than the destination.

Run: xcopy /? for a full list of switches but here are some useful ones if you are moving a large amount of data and want to keep NTFS permission.

Perform an Initial full copy preserving permissions

xcopy "C:\Source Folder" "\\Destination Server\Share\Folder" /X /H /E /V

Copy files or folders that have changed since the initial copy

xcopy "C:\Source Folder" "\\Destination Server\Share\Folder" /X /H /E /V /D /Y

Switch Explanation

/X – Copies file audit settings and file ownership and ACL information.
/H – Copies hidden and system files.
/E – Copies directories and subdirectories, including empty ones.
/V – Verifies each new file.

/D – Copies files changed on or after the specified date (D:m-d-y).If no date is given, copies only those files whose source time is newer than the destination time.
/Y – Suppresses prompting to confirm you want to overwrite an existing destination file.

10 thoughts on “Using xcopy to copy files and folders and keeping the ntfs permissions”

  1. I would like to put one one more software here for consideration. As there are several programs which claim to be able to preserve the creation date of files. The best among those few programs which surely will do the trick is GS RichCopy 360. The software provides allot of other features like e-mail notification when job is done, scheduling your copy etc. Its very robust and reliable. I’ve been using it myself from a long time. You must give it a try. Hope this might help.

    Reply
  2. I am getting error following message on xcopy command : “security information not supported by destination file system” what is the solution?

    Reply
  3. With error security information not supported by destination file system, do both destination and source have to be the same file system? So NTFS with NTFS and Fat32 with Fat32?

    Reply
  4. Hello,

    I want to move “rents” folder in which there are some files to “5_YEARS_ARCHIEVE”. However, when clicking enter, the system moves files, not folder.

    I want to move just folder (rents).

    The code I used: xcopy “F:\jobs\rents” “I:\5_YEARS_ARCHIEVE” /X /H /E /V

    What is the problem?

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share

Please consider sharing.