Windows – How to copy ONLY those files that are not in the destination

robocopywindows

Is it possible to use robocopy to copy only the files that do not exist in destination?

robocopy has a /is (include same files) switch. What I am looking for is an /xs switch. If a file exists in both the source and the destination I don't want it to be copied. The criteria is file name only, regardless of modified day, size, etc. For example, even if the source has a newer file (based on modified date) than the same file in the destination, I don't want it to be copied. Possible to do this? Thanks.

Best Answer

Just use the /xc (exclude changed) /xn (exclude newer) and /xo (exclude older) flags:

robocopy /xc /xn /xo source destination 
Related Question