Skip to content

Instantly share code, notes, and snippets.

@c3rberus
Created November 1, 2022 01:09
Show Gist options
  • Save c3rberus/a2a808a748f8d082e4f22cb814c84ece to your computer and use it in GitHub Desktop.
Save c3rberus/a2a808a748f8d082e4f22cb814c84ece to your computer and use it in GitHub Desktop.
Robocopy Mirroring Directory and Permissions
#To do a mirror operation and properly copy the file and folder permissions, use the /sec and /secfix commands. The /sec command will copy the file security over for changed files, while the /secfix command will update the security for unchanged files.
#By combining these commands with /mir you will effectively mirror all of the files, folders, and permissions from a source directory to a destination.
robocopy D:\Source\ D:\Destination /mir /sec /secfix /v /log:copy.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment