Robocopy parameters?

About a month ago my scheduled batch backup using xcopy began to fail.  I posted a question about the issue on EE and eventually scrapped the xcopy  with a new backup using Robocopy

Old xcopy Backup
xcopy "I:\My Documents\*.*" "K:\Mike\" /s /y /f

Open in new window

Robocopy backup
set LogFile=I:\My Documents\copylog.txt
RoboCopy "I:\My Documents" "K:\RoboCopy" /E /TEE /LOG+:"RoboCopyLog.txt"

The xcopy retained files on the destination that had been removed from the source and I set up the new Robcopy to do the same.

Now the xcopy backup contains files that aren’t in the new Robocopy backup.  These would be files that had been removed from the source drive over time.

The source directory for both backups is I:\My Documents.  There are many subdirectories under this main directory.
I would like to set up a onetime Robocopy that will copy from K:\Mike to K:\Robocopy.  However, the only files (and possibly directories I want to copy are the ones that don’t exist in K:\Robocopy.

What parameters do I use on the onetime RoboCopy to accomplish this?
RoboCopy "K:\Mike" "K:\RoboCopy"  /?????
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
I believe you can do:

robocopy /e /xc /xn /xo source destination

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
☠ MASQ ☠Commented:
You have to be a bit creative with the switches to do this & RC users often ask for this to be a single switch

This should do it:

 X:\SourceFolder Y:\DestinationFolder /E /XC /XN /XO

It's really a recursive copy excluding anything that matches the destination - there's one caveat which is if you have same filename but different version in the same location on the destination RC will not overwrite it.

EDIT ... What Bill said above :)
mlcktmguyAuthor Commented:
Bill PrewIT / Software Engineering ConsultantCommented:

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.