Skip to content

Instantly share code, notes, and snippets.

@yradunchev
Created September 18, 2015 04:18
Show Gist options
  • Select an option

  • Save yradunchev/cbf7e07796256b2e5521 to your computer and use it in GitHub Desktop.

Select an option

Save yradunchev/cbf7e07796256b2e5521 to your computer and use it in GitHub Desktop.
Copy folder with permissions
robocopy source destination /E /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log
@yradunchev
Copy link
Copy Markdown
Author

source :: Source Directory (drive:\path or \server\share\path).
destination :: Destination Dir (drive:\path or \server\share\path).
/E :: copy subdirectories, including Empty ones.
/ZB :: use restartable mode; if access denied use Backup mode.
/DCOPY:T :: COPY Directory Timestamps.
/COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU). Copies the Data, Attributes, Timestamps, Owner, Permissions and Auditing info
/R:n :: number of Retries on failed copies: default is 1 million but I set this to only retry once.
/W:n :: Wait time between retries: default is 30 seconds but I set this to 1 second.
/V :: produce Verbose output, showing skipped files.
/TEE :: output to console window, as well as the log file.
/LOG:file :: output status to LOG file (overwrite existing log).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment