Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xcopy Can't read file: .txt

11 views
Skip to first unread message

Jean Pierre Daviau

unread,
Jun 11, 2003, 1:13:11 PM6/11/03
to
Well, Hi,
If I take of /EXCLUDE:.txt everything's k.
It would be nice if this feature would work.

xcopy *.* C:\a /D:06-11-2003 /EXCLUDE:.txt /S/E/I/Y

Can't read file: .txt

--
http://cerbermail.com/?SvnGz1p37U
Jean Pierre Daviau
--
ASUS P4S533-E win2000 JVIEW JDK1.1.8 Borland commandline 5.5

http://web.JeanPierreDaviau.com


Ritchie

unread,
Jun 11, 2003, 3:36:24 PM6/11/03
to
"Jean Pierre Daviau" <jpda...@videotron.ca> wrote in message news:EqJFa.4840$_96.1...@weber.videotron.net...

> Well, Hi,
> If I take of /EXCLUDE:.txt everything's k.
> It would be nice if this feature would work.
>
> xcopy *.* C:\a /D:06-11-2003 /EXCLUDE:.txt /S/E/I/Y

You've misunderstood the poorly written documentation (like many others -
this query returns 27 results!)

http://groups.google.com/groups?q=cmdprompt.admin+xcopy+exclude+file

--
Ritchie


Jean Pierre Daviau

unread,
Jun 11, 2003, 5:32:56 PM6/11/03
to
They should have put Robocopy.exe (wich I dont have) with win2K instead.

Thanks.

Alan Rabideau

unread,
Jun 14, 2003, 10:28:23 PM6/14/03
to
Have you tried:

xcopy *.* C:\a /D:06-11-2003 /EXCLUDE:*.txt* /S/E/I/Y

>.
>

Mark V

unread,
Jun 15, 2003, 2:43:05 AM6/15/03
to
Alan Rabideau wrote in news:02c901c332e5$cb50de00$a301...@phx.gbl:

> Have you tried:
>
> xcopy *.* C:\a /D:06-11-2003 /EXCLUDE:*.txt* /S/E/I/Y

I quote from the first responder:


"You've misunderstood the poorly written documentation (like many

others - ... "

That is just not how xcopy works. The parameter for the /EXCLUDE:"
switch is not a filespec but rather a fileName (of a plain ACSCII
file) to use as the source of the exclusion strings.

[ ]

Jean Pierre Daviau

unread,
Jun 15, 2003, 9:17:37 AM6/15/03
to
Indeed:
they show in xcopy /?

EXCLUDE:\folder name\
but I noted that has to be written in the list file
EXCLUDE:dontbk.txt

********
file.txt
folder -----note wit no slashes
etc

***********

Marty List

unread,
Jun 16, 2003, 11:44:56 AM6/16/03
to

That's not what I see, I've never seen "EXCLUDE:\folder name\".

This is from xcopy /? on Win2000 SP3:

/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
.obj extension respectively.

Bob I

unread,
Jun 23, 2003, 9:06:51 AM6/23/03
to
Your problem is that the "EXCLUDE" is expecting a filename the contents
of which is a list of things to exclude.

Make a file listing the excluded items and put the name of the file
after EXCLUDE:

Kevin

unread,
Jul 13, 2003, 9:24:18 AM7/13/03
to
All
I think the issue has to do with path. Even though /exclude:filename
is a new caommand for Windows 2000 (at least according to the docs),
this switch appears to be a copy of /e from earlier versions. We could
not get this to work either, until someone suggested putting the
exclude file in the root. That worked. We went back to the batch file
and used old DOS naming conventions for longfilenames in the path,
that worked as well. Conclusion, /exclude cannot read longfilenames,
and needs an absolute path to its intended file.

Hope this helps.

Kevin

Bob I <bir...@yahoo.com> wrote in message news:<3EF6FB6B...@yahoo.com>...

Kevin

unread,
Jul 13, 2003, 9:24:25 AM7/13/03
to
All
I think the issue has to do with path. Even though /exclude:filename
is a new caommand for Windows 2000 (at least according to the docs),
this switch appears to be a copy of /e from earlier versions. We could
not get this to work either, until someone suggested putting the
exclude file in the root. That worked. We went back to the batch file
and used old DOS naming conventions for longfilenames in the path,
that worked as well. Conclusion, /exclude cannot read longfilenames,
and needs an absolute path to its intended file.

Hope this helps.

Kevin

Bob I <bir...@yahoo.com> wrote in message news:<3EF6FB6B...@yahoo.com>...

Jim H

unread,
Sep 20, 2003, 9:11:07 AM9/20/03
to
Despite how the command prompt appears to work in regards to filename
conventions, the safest way to write any command prompt is to escape the
filenames with quotes. This forces the command shell to handle it and pass
the results to whatever you called. You can also use ".\" before any file
descripter to force it to look locally, creating this:

xcopy *.* C:\a /D:06-11-2003 /EXCLUDE:".\ListofTxtFiles.txt" /S/E/I/Y

Would parse a file ListofTxtFiles.txt containing strings (in this case .txt)
that xcopy should exclude. If using this for scripts, try creating a root
directory of Scripts and store the exclusion files there, add an enviroment
variable, and parse that, IE:

SET ExclPath=C:\Scripts\Exclusion
xcopy *.* C:\a /D:06-11-2003 /EXCLUDE:"%ExclPath%\ListofTxtFiles.txt"
/S/E/I/Y

J...@ccsconsultants.com

"Kevin" <kpw...@yahoo.com> wrote in message
news:225d7711.03071...@posting.google.com...

Jean Pierre Daviau

unread,
Oct 21, 2003, 9:01:23 AM10/21/03
to
In fact on win2000 if I take off the "" in
/EXCLUDE:".C:\Scripts\Exclusion\file.txt"
it works
"Jim H" <J...@ccsconsultants.com> wrote in message
news:%23G0tti3...@TK2MSFTNGP10.phx.gbl...
0 new messages