3

I using xcopy, and I am trying to exclude directories with specific ending name from copying. I've put the bellow line in exclude_files.txt to ignore those directories:

\\\*_bkup\\

Also, the xcopy command is the one bellow:

xcopy "C:\localfolder" "\\\server\remotefolder" /E /exclude:exclusion_list.txt

Only that it just doesn't ignore those directories. What would the workaround be? I need it to ignore these directories in all of the tree's structure, not only in the root.

Adrian Cumpanasu
  • 1,028
  • 1
  • 10
  • 24
  • `xcopy` is kind of lame. With `xcopy`, you can't even recursively copy a directory. You should probably follow benham's advice and use `robocopy`. – jww Dec 08 '14 at 04:53

1 Answers1

3

The /EXCLUDE option does not use wild cards in the masks. Use _bkup\ instead, without the wildcard.

But really you should be using ROBOCOPY instead. It may take a bit more study to figure it out, but it is much more powerful and precise.

dbenham
  • 127,446
  • 28
  • 251
  • 390