Re: xcopy Can't read file: .txt

K

Kevin

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
 
J

Jim H

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

(e-mail address removed)
 
J

Jean Pierre Daviau

In fact on win2000 if I take off the "" in
/EXCLUDE:".C:\Scripts\Exclusion\file.txt"
it works
 

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

Similar Threads

ROBOCOPY or XCOPY exclude 0
XCOPY "Exclude" option 3
XCopy Exclude Function NOT Working 2
Using xcopy for backup 10
Windows 7 Read Registry Value 2
XCOPY /exclude file not read 7
/exclude switch in XCOPY 3
Problem with Xcopy 9

Top