Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

robocopy /xc /xn /xo source destination 
share|improve this answer
    
That does not work (at least if you have other options as well - i.e. /b /e /copyall). Robocopy looks at timestamp and I believe even if the last accessed time stamp is different, it will copy. If there is a way, would love to know about it. –  user174865 Nov 21 '12 at 2:49
    
The /xn and /xo options should prevent robocopy from copying because of a different timestamp. Worked fine when I tested it. Robocopy does not pay attention to the last accessed timestamp. Your answer will probably be removed (because it isn't an answer) but you can email me if you want to discuss this. –  Harry Johnston Nov 21 '12 at 3:41
    
works perfectly. Thanks! –  Valamas May 1 '13 at 22:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.