XCOPY to include deletion of non-existing files

H

hmm

I use XCOPY to keep an updated copy (on a removable disk) of selected folders
from my hard drive. I already use the /D switch to copy only files that have
changed since the last update. But what I don't know how to do is
automatically instruct XCOPY to delete files that no longer exist on the hard
drive folder (in case, for example, they were deleted). Perhaps such a
deletion could be done with another batch-file command, but I was unable to
find one in Command Prompt Help. Does anyone know how to do it?
 
P

Pegasus \(MVP\)

hmm said:
I use XCOPY to keep an updated copy (on a removable disk) of selected
folders
from my hard drive. I already use the /D switch to copy only files that
have
changed since the last update. But what I don't know how to do is
automatically instruct XCOPY to delete files that no longer exist on the
hard
drive folder (in case, for example, they were deleted). Perhaps such a
deletion could be done with another batch-file command, but I was unable
to
find one in Command Prompt Help. Does anyone know how to do it?

You cannot do this with xcopy.exe but you can with robocopy.exe. You can get
it from here:
http://www.microsoft.com/downloads/...69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top