XCopy Exclude Function NOT Working

D

Danny Kile

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.

Thank you, in advance for any help!

Danny,



--
Danny Kile
Please reply to the Newsgroup ONLY

"Dogs come when they're called, CATS take a message and get back to
you." Mary Bly
 
T

Tom Porterfield

Danny said:
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.
 
D

Danny Kile

Tom said:
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.

I have moved the batch file and the Exclude.txt file to the root
directory of c: and then added the following to the beginning of the
batch file.

c:
cd\

That seems to have solved the problem.

Thank you


--
Danny Kile
Please reply to the Newsgroup ONLY

"Dogs come when they're called, CATS take a message and get back to
you." Mary Bly
 

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


Top