Re: XCopy Exclude Function NOT Working



Danny Kile wrote:
I use Xcopy to make backup of important files and folders to an external
hard drive. However, in this long list of files and folders there is one
folder that I would like to exclude. I run this from a batch file with
some other Xcopy command as well the trouble command line follows along
with the contents of the exclude file list.

Batch file command:

xcopy "C:\Documents and Settings\Danny\Application Data\*.*" "H:\Dannys
Desktop PC Backup\Application Data\*.*" /h /e /r /d /y
/exclude:exclude.txt

The Exclude.txt file contains:

\Cache\

I have tried also cache, cache\, \cache\, and \*cache*\ I have also
tried not using the exclude.txt file and putting the directory in
question right in the command line. The command copies everything in the
C:\Documents and Settings\Danny\Application Data\ path including the
cache folder.

The \Cache\ syntax is correct. My guess is for some reason it isn't finding the exclude.txt file. What is the directory that cmd.exe is in when running the batch file? Possibly make the first line of the batch file one that CD to the directory with the batch file and exclude.txt file.
--
Tom Porterfield

.



Relevant Pages

  • Re: USB drive problem
    ... Once per month I update the files using a batch file ... using this context for the copy command: ... that folder. ... The first problem I see is that there is no U or S switch for COPY. ...
    (alt.comp.hardware.pc-homebuilt)
  • Re: select files by dates using a script files
    ... You could use Robocopy.exe // and run it as command before in Cobian. ... Use Robocopy to move the "old" files out of the original folder to an FTP ... /XC:: eXclude Changed files. ...
    (microsoft.public.windows.server.sbs)
  • Re: Sophisticated(!) copying in DOS
    ... Try running from the command line rather than batch file till it works. ... Try using shorter path or local drive for the exclude file. ... folks, I KNOW I shouldn't put double-quotes inside double quotes, but I sure ...
    (microsoft.public.windowsxp.general)
  • Re: Ways to get a Directory Listing in a Text File, or Printed out - Re: Web site directories
    ... Use the CD Command, in a Command Prompt Window ... That doesn't specify a folder, just changes to the specified folder, ... if yo ucall up a Script (or Batch File) by using the *RightClick* ...
    (uk.people.silversurfers)
  • Re: How to copy whole folders?
    ... First of all your syntax is different than xcopy help shows: ... I want just to move my batch file from one folder to another and run it ... error and restart the same xcopy command until all files are copied. ...
    (microsoft.public.windows.file_system)