Question : Batch File: XCOPY - Exclude Files

Hi there,

Using following command line, I need to exclude the following files and folders.

My problem here is that the files containing wild cards are not excluded.


COMMAND LINE:
----------------------------------
XCOPY "!BasePath_Source!" "!BasePath_Dest!" /S /L /F /Y /D /EXCLUDE:Exclude.txt


Exclude.txt
----------------------------------
*.mp3
*.wma
*.wav
*.avi
*.mpg
~*.*
*.tmp
Thumbs.db
\temp\
\System Volume Information\
\RECYCLER\
\Virtual Machines Garage\
\Virtual Machines Microsoft\
\Virtual Machines VMWARE\


Thanks for your help,
Rene

Answer : Batch File: XCOPY - Exclude Files

/EXCLUDE uses exact string matching, not pattern matching. That is: No wildcards, please. Your list should hence contain

.mp3
.wma
.wav
.avi
.mpg
~
.tmp
Thumbs.db
\temp\
\System Volume Information\
\RECYCLER\
\Virtual Machines Garage\
\Virtual Machines Microsoft\
\Virtual Machines VMWARE\

But that is inprecise, in particular with the tilde - it will exclude names like   a~b   also.
Random Solutions  
 
programming4us programming4us