Been using robocopy for a while and I thought it would be useful to list a few things it can do:
- Delete long directories or filenames:
robocopy /purge c:\empty [to be deleted directory]
- Copy all drive/directories/files without changing any attributes:
robocopy /copyall /mir /xj [sourcefile] [destination]
- Copy all drive/directories/files excluding duplicates:
robocopy /copyall /mir /xj /xc /xn /xo [sourcefile] [destination]
- 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.