XCOPY EXCLUDE command

R

Richard Beilby

The EXCLUDE command of XCOPY does not work properly. For instance, if
one tries the following:-
XCOPY C:\*.BAT C:\TEMP\TEST /EXCLUDE:AUTOEXEC.BAT all the BAT files are
copied including AUTOEXEC.BAT!

XCOPY C:\TEMP\*.* C:\TEST\ /S/EXCLUDE:C:\TEMP\TEST\ the error message
Can't open file: C:\TEMP\TEST\ given. Any variation on the above EXCLUDE
format gives the same error message.

Anybody got an idea on what could be wrong please.
 
S

Steve Duff [MVP]

I haven't used it in a long time, but I believe the /EXCLUDE switch names a >text file<
you create that contains one or more lines. If any part of the filename being copied matches
one of the lines in this file it is ignored and not copied.

Steve Duff, MCSE, MVP
Ergodic Systems, Inc.
 
R

Richard Beilby

Thank you, Steve. I misread the instructions. Very similar to the PKZIP
command then.
 

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