XCOPY "Exclude" option

  • Thread starter Thread starter klaus
  • Start date Start date
K

klaus

Does any one know how this works?
I can not figure out how to use the XCOPY command to
EXCLUDE files from being copied.
It either copies the files anyway, or it aborts the
command stream.
Here is an actual example:

e:\docs>xcopy e:\docs\*.* f:\archive\weekly03
\daily\*.* /exclude:e:\docs\quicken\backup /m /c /i /v
/r /y /s
Can't read file: e:\docs\quicken\backup
0 File(s) copied

e:\docs>dir e:\docs\quicken\backup1
Volume in drive E is WD160-DATA
Volume Serial Number is 68D4-EA2A

Directory of e:\docs\quicken\backup1

12/30/2003 09:05 AM <DIR> .
12/30/2003 09:05 AM <DIR> ..
10/03/2003 02:59 PM 0 klaus.NPC
12/30/2003 09:05 AM 4,034,232 klaus.QDF
12/30/2003 09:05 AM 2,137,088 klaus.QEL
12/29/2003 11:17 AM 976,510 klaus.QPH
12/30/2003 09:05 AM 473,301 klaus.QSD
01/19/2003 11:15 AM 4,276 klaus.QTX
6 File(s) 7,625,407 bytes
2 Dir(s) 327,491,584 bytes free
 
With the exclude option, you create a file with the filenames or extensions
that you want to exclude and then you /e: the path to that file. xcopy will
open that file and read the contents of it to gather the information about
what files to then exclude.

Ray at work
 
The exclude file is a FILE (or files: FILE1+FILE2...), not a file or
directory specification, which contains the file specs (substrings) to
exclude, one per line...

xcopy f:\pictures \\bliss\cd\pictures /d:%1 /s /e /Q /c /I /Y
/EXCLUDE:%HOME%\pixex.txt >> %HOME%\xcoppix.txt 2>>
%HOME%\xcoppix.errors.txt

where pixex.txt is
\pictures.b\
\pictures\movies\
..html
..htm
..bak
..asp

Do an xcopy /? for additional information.
 
Back
Top