Robocopy: MS power copy tool

Been using robocopy for a while and I thought it would be useful to list a few things it can do:

  1. Delete long directories or filenames:
    robocopy /purge c:\empty [to be deleted directory]
  2. Copy all drive/directories/files without changing any attributes:
    robocopy /copyall /mir /xj [sourcefile] [destination]
  3. Copy all drive/directories/files excluding duplicates:
    robocopy /copyall /mir /xj /xc /xn /xo [sourcefile] [destination]
  4. Copy all drive/directories/files excluding duplicates and skip failed reads/writes instead of retrying infinitely:
    robocopy /copyall /mir /xj /xc /xn /xo /w:1 /r:1 [sourcefile] [destination]

NOTE: The /mir option will delete the destination’s files/directories if they do not exist in source. So if you don’t want that to happen, replace /mir with a /e instead.

Leave a Reply

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

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