Q: copy files with exclusion

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I need to copy all the files that have changed to a new folder periodically
excluding AAA*.txt and BBB*.txt in a batch file. I tried to use xcopy however
it seems /EXCLUDE does not support * wildcard. Is there any way I can do this?

Thanks,
 
JIM.H. said:
I need to copy all the files that have changed to a new folder periodically
excluding AAA*.txt and BBB*.txt in a batch file. I tried to use xcopy however
it seems /EXCLUDE does not support * wildcard. Is there any way I can do this?

Typing XCOPY /? at the command line to get help produces a display which
includes the following:

/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. When any of the
strings match any part of the absolute path of the file to be
copied, that file will be excluded from being copied. For
example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the

So what goes in your EXCLUDE parameter is the name of a file in which
you have listed the strings "AAA*.txt" and "BBB*.txt".
 
JIM.H. said:
I need to copy all the files that have changed to a new folder periodically
excluding AAA*.txt and BBB*.txt in a batch file. I tried to use xcopy however
it seems /EXCLUDE does not support * wildcard. Is there any way I can do this?

Take a careful look at XCOPY /?
The /exclude information should be in a file, and wildcards are
implicit.

All the best, Timo
 
Back
Top