Categories
Utility

RoboCopy – Exclude existing files.cmd

robocopy.exe d:\Sourcepath e:\Destpath /E /XC /XN /XO
The command line switches:

/E makes Robocopy recursively copy subdirectories, including empty ones.

/XC excludes existing files with the same timestamp, but different file sizes. Robocopy normally overwrites those.

/XN excludes existing files newer than the copy in the source directory. Robocopy normally overwrites those.

/XO excludes existing files older than the copy in the source directory. Robocopy normally overwrites those.

With the Changed, Older, and Newer classes excluded, Robocopy will exclude files already existing in the destination directory.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s