Q: copy files with exclusion

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,
 
G

Gary Smith

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".
 
T

Timo Salmi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top