user2897448
user2897448

Reputation:

Excluding directories using wildcards

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.

Upvotes: 3

Views: 2780

Answers (1)

dbenham
dbenham

Reputation: 130919

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.

Upvotes: 4

Related Questions