Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Xcopy exclude help! Please read

Original Message
Name: BlackIce
Date: April 17, 2005 at 04:52:10 Pacific
Subject: Xcopy exclude help! Please read
OS: XP
CPU/Ram: 512
Comment:
Hey! I'm new to xcopy but i get the overall idea. I've been keeping my script simple, what my script does is a copy of important files on my computer to another computer on the network incase one crashes or whatever. Most of the script worked fine except for the exclusion of files and some lines just didn't work without reason!

One of my lines in this batch file was-

xcopy "C:\Program Files\Macromedia" "H:\Gilpo Backup\Program Files\Macromedia" /I

This didn't work yet i wrote my other lines like that and they did work, after the line above i got '0 File(s) copied'

I also got an error like this one below for a different line:

C:\Documents and Settings\Blayne\Desktop>xcopy "C:\Program Files\Maxis\SimCity 3
000\Cities\StarterTowns\*sc3 "H:\Gilpo Backup\Program Files\Maxis\SimCity 3000\C
ities\StarterTowns" /I
Parse Error

Once again I can't find the problem, and last but not least the major one that I just can't get!!! I've checked sooo many websites and forums here but I just didn't get it.

xcopy "C:\Documents and Settings\Blayne\My Documents" "H:\Gilpo Backup\Blayne" /I /exclude:"\Unreal Tournament\"+\Incomplete\+\KaZaA\+\MGI\

I got an error saying 'Can't read file: "\Unreal Tournament\"'

That didn't work but i also tried on top of that another method-

xcopy "C:\Documents and Settings\Blayne\My Documents" "H:\Gilpo Backup\Blayne" /I /exclude:"C:\Documents and Settings\Blayne\Desktop\exclude1.txt"

In the exclude1.txt file i had the following lines-

"C:\Documents and Settings\Blayne\My Documents\Unreal Tournament\"
"C:\Documents and Settings\Blayne\My Documents\Incomplete\"
"C:\Documents and Settings\Blayne\My Documents\KaZaA\"
"C:\Documents and Settings\Blayne\My Documents\MGI\"

None of these methods have worked and I'm only very new to all this so could someone please help me it would be appreciated very much.

Thnx


Report Offensive Message For Removal


Response Number 1
Name: Dr. Nick
Date: April 17, 2005 at 12:41:09 Pacific
Subject: Xcopy exclude help! Please read
Reply: (edit)
xcopy "C:\Program Files\Macromedia" "H:\Gilpo Backup\Program Files\Macromedia" /I

Maybe try putting an ending \* when dealing with directories. For example: xcopy "C:\Program Files\Macromedia\*" "H:\Gilpo Backup\Program Files\Macromedia" /I

xcopy "C:\Program Files\Maxis\SimCity 3
000\Cities\StarterTowns\*.sc3" "H:\Gilpo Backup\Program Files\Maxis\SimCity 3000\C
ities\StarterTowns" /I

You got a parse error because it couldn't parse the input (duh :). You're missing a quote and you should really have a dot between the * and the sc3 (both highlighted above).

To exclude things, try not using the complete paths, and you need leading slashes. For example, your exclude file might look like:

\My Documents\Unreal Tournament\
\My Documents\Incomplete\
\My Documents\KaZaA\
\My Documents\MGI\

Also, on these you probably want to use a couple more switches if it's being used to backup files. You may want to use:

/E - copy all subfolders
/Y - don't prompt to overwrite older files
/C - continue copying after error
/V - verify files after copy
/R - overwrite read-only files
/Z - copy in restartable mode

Try some of these and see if they help.



Report Offensive Follow Up For Removal

Response Number 2
Name: BlackIce
Date: April 17, 2005 at 17:21:30 Pacific
Subject: Xcopy exclude help! Please read
Reply: (edit)
Dr. Nick,
Thanks heaps I'd overlooked the parse error (silly me, sorry), I didn't know about the '*.sc3' that really helped thanks. I tried the "...\macromedia\*" but unfortunatly it still says '0 Files copied.' I changed the exclude to like u said /exclude:"C:\Documents and Settings\Blayne\Desktop\exclude1.txt" but i still get the error 'Can't read file "C:\Documents and Settings\Blayne\Desktop\exclude1.txt"

In the exclude1.txt I put in what you said-

\My Documents\Unreal Tournament\
\My Documents\Incomplete\
\My Documents\KaZaA\
\My Documents\MGI\

I've tried with and without quotation marks. It isn't working though because it can't read the file as I said above. The macromedia one I haven no clue at all, it just won't copy files.



Report Offensive Follow Up For Removal

Response Number 3
Name: BlackIce
Date: April 18, 2005 at 03:35:24 Pacific
Subject: Xcopy exclude help! Please read
Reply: (edit)
Hey Dr Nick and anyone else reading. I needed the /E for the macromedia folder. Thanks :), as you can see i'm new to this lol. The exclude thing is about the only thing not working now so if anyone could help with that please read my post above. Also just wondering is there a way to apply your switches to every line in you r script without writing the switches on each sepearte line?
Thanks guys, especially you Dr Nick!

Report Offensive Follow Up For Removal

Response Number 4
Name: pratcp
Date: April 21, 2005 at 11:44:54 Pacific
Subject: Xcopy exclude help! Please read
Reply: (edit)
I am running into the same issue. I am trying to write a vbscript to perform a xcopy and copy files from my dev server to the QA server and I do not want the uploads folder where we store user upload documents to be overwritten...I cant seem to get the exclude switch working at all. here is xcopy command I am trying to use

xcopy \\dev\appfolder \\qa\appfolder /E/Y/Exclude:"exclude.txt"

And I get the error Can't read file: exclude.txt

I checked if this had to do with permissions on this file in my C: drive, but the file has full control for everyone. Any help will be great


Report Offensive Follow Up For Removal

Response Number 5
Name: pratcp
Date: April 21, 2005 at 11:55:05 Pacific
Subject: Xcopy exclude help! Please read
Reply: (edit)
I guess I have figured out a way to work with exclude

C:\>xcopy \\dev\appfolder /Exclude:exclude_folder.txt \\qa\appfolder /E/Y

This command worked!


Report Offensive Follow Up For Removal


Response Number 6
Name: BlackIce
Date: April 27, 2005 at 02:21:07 Pacific
Subject: Xcopy exclude help! Please read
Reply: (edit)
Hey Prat,
Ok here's what you do for your problem. The following worked for me and the crucial key is that you can't have spaces in your directory name for the exclude text file. I tried with "speach marks" but it just doesn't work. The following worked for me though---

xcopy "C:\Documents and Settings\Blayne\My Documents" "H:\Gilpo Backup\Blayne" /I /E /Y /C /V /R /Z /K /H /exclude:C:\Backupexclude\exclude1.txt

That's straight out of my script. In the exclude1.txt i have things like...

\My Documents\MGI\
\My Documents\Music\

Just change it to suite you and it works provided you don't have any spaces in the exclude directory:

/exclude:C:\Backupexclude\exclude1.txt

No spaces for C:\Backupexclude\exclude1.txt

If you had C:\Backup exclude\exclude1.txt it wouldn't work. Pretty silly if you ask me but that's the probelm. Also in your txt document rather than putting things like:

\Music\

It's better to add a folder or more before so...

\My Documents\Music\

Note: remember to have a slash after your last folder in this case '\Music\' not '\Music'

Hope this helps =)


Black Ice


Report Offensive Follow Up For Removal

Response Number 7
Name: student
Date: April 27, 2005 at 15:03:25 Pacific
Subject: Xcopy exclude help! Please read
Reply: (edit)
Hi,
I got two hard drives in my machine. I want to copy all files of an old drive (C: drive) to a new drive. So when the old drive (C: drive) is not working, I can plug into the new drive and working on the new drive. I am using xcopy commands in windows 2000 safe mode. I have not installed the Ghost program. So I use the xcopy commands.Why the exclue pamater notworking?

student always learning


Report Offensive Follow Up For Removal

Response Number 8
Name: student
Date: April 27, 2005 at 15:06:04 Pacific
Subject: Xcopy exclude help! Please read
Reply: (edit)
Basically, I want to copy all files on C: drive to new hard drive (E:) I use the command: xcopy C: E: /s /e /h /exclude: System Volume Information. The error message is "Invalid number of parameters"
I much appreciate the help

student always learning


Report Offensive Follow Up For Removal

Response Number 9
Name: Niteling
Date: May 30, 2005 at 21:12:44 Pacific
Subject: Xcopy exclude help! Please read
Reply: (edit)
Some things of note about xcopy:

- In reply to 'student', /EXCLUDE does not support filenames with spaces, in any form. I've tried quoting them singly, doubly, quoting the whole argument, etc. -- the only way I've found to use an exclude file with spaces in its pathname is to use the old 8.3 name for it:

won't work: /EXCLUDE:"C:\Documents and Settings\Me\exclude.txt"

works: /EXCLUDE:C:\Docume~1\Me\exclude.txt


- As alluded to by Dr. Nick, xcopy's /? documentation is wrong when it says:

/EXCLUDE:file1[+file2][+file3]...
... 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. ...

It should probably say *relative* path, because that's what happens. For example, suppose my exclusions file contains the line

C:\Documents and Settings\Me\Start Menu

and I invoke xcopy from "C:\Documents and Settings\Me\" with a source argument of "*". xcopy will copy the Start Menu folder because "C:\Documents and Settings\Me\Start Menu" is not a substring of "Start Menu\".

However, if I were to invoke xcopy with a source argument of "C:\Documents and Settings\Me", xcopy uses the full absolute paths to match against my exclusion list, and now indeed "C:\Documents and Settings\Me\Start Menu" is a substring of "C:\Documents and Settings\Me\Start Menu".

- (not really related to this post, but whatever) When using the /m option (copy only files with Archive, then clear Archive), xcopy does not clear the archive bits until after *all* files are done copying. This can be handy, e.g. you're in the middle of a backup and you notice your exclusions file isn't working.


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Xcopy exclude help! Please read

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




XP Installed to G?

exessive internet traffic

ZoneAlarm Question. Blocked Connect

Windows Live Messenger Problem

Delete $Uninstall after SP3 updates


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC