backup with xcopy

  • Thread starter Thread starter Kostas K.
  • Start date Start date
K

Kostas K.

Hello!

I want to use xcopy to copy a few folders from one drive to to another
folder on another drive for backup purposes. Could somebody tell me how to
do it with a single xcopy statement?

e.g. instead of writing:

xcopy c:\1 d:\
xcopy c:\2 d:\
xcopy c:\3 d:\

write something like that (the following does not work)

xcopy c:\1+c:\2+c:\3 d:\

Thank you

Kostas
 
Kostas K. said:
I want to use xcopy to copy a few folders from one drive to to another
folder on another drive for backup purposes. Could somebody tell me how to
do it with a single xcopy statement?
e.g. instead of writing:
xcopy c:\1 d:\
xcopy c:\2 d:\
xcopy c:\3 d:\
write something like that (the following does not work)
xcopy c:\1+c:\2+c:\3 d:\

It can't be done with a single XCOPY command, but if you simply
save your block of commands as a text file and name it with a .BAT
extension (e.g., BACKUP.BAT), then run BACKUP as a command, the batch file
will automatically execute your XCOPY commands in sequence.

--Donald Davis
 
Donald said:
--Donald Davis

Better yet, just download XXcopy. It's free. Bypasses the limitations of
the MS version of Xcopy. XXcopy works great--I use it all the time to
mirror my HDs.
 
I have tried both xxcopy and microsoft's robocopy.

But my problem remains the same,

either with xxcopy /clone or robocopy /mir, how can I select multiple
directories to do my backup all in one go?
 
Use a FOR statement. You work out the exact syntax (Microsoft shits me).
Something like:

for %f in (c:\1 c:\2 c:\3) do xcopy %f d:\
 
Back
Top