xcopy /exclude option

C

Curt Zarger

The exclude option supports a list of files containing strings
specifying files to be excluded. I am trying to exclude .vb, so I
have the string ".vb" (without the quotes) in my exclude file. This
excludes files with the .vb extension; however, it also exclude files
such as "filename.vbs", which I do not want to be excluded.

How can I get better control of the restriction being defined? Is
there a regular expression capability or any other options?

THX

Curt
 
T

Torgeir Bakken (MVP)

Curt said:
The exclude option supports a list of files containing strings
specifying files to be excluded. I am trying to exclude .vb, so I
have the string ".vb" (without the quotes) in my exclude file. This
excludes files with the .vb extension; however, it also exclude files
such as "filename.vbs", which I do not want to be excluded.

How can I get better control of the restriction being defined? Is
there a regular expression capability or any other options?

Hi

Maybe robocopy.exe is better at this...

Info and download link for the latest version of robocopy.exe here:

http://groups.google.com/[email protected]



--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx
 
R

Ray McCormick

Hi
I think you will find that xxcopy will do this also.
See www.xxcopy/com .
This is a much enhanced xcopy with over a hundred switches
available.
Ray
 
R

Ritchie

Curt Zarger said:
The exclude option supports a list of files containing strings
specifying files to be excluded. I am trying to exclude .vb, so I
have the string ".vb" (without the quotes) in my exclude file. This
excludes files with the .vb extension; however, it also exclude files
such as "filename.vbs", which I do not want to be excluded.

How can I get better control of the restriction being defined? Is
there a regular expression capability or any other options?

If it's acceptable to modify the ARCHIVE attribute, then a workaround is
to set the ARCHIVE attribute of all files, then clear it for files that
have a ".vb" extension. Now use XCOPY with the /A switch. Something
like:-

attrib +a src\*.* /s /d
attrib -a src\*.vb /s /d
xcopy src\*.* dest /a
 

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