Guest Jack Gillis Posted July 17, 2007 Posted July 17, 2007 I have an old fashioned batch file I use very often under XP to do a backup of My Documents to a USB Flash Drive. It contains, among other things, this statement and works just fine and has so for years. xcopy "d:\My Documents\*.*" "U:\My Documents\" /D /Y /s I have added many MP3 files to My Music and there is not room for them on the USB Drive. Have tried to use the /EXCLUDE parameter tacked on to the end of the statement but cannot get it to work. I keep getting 'parse' error or 'Cannot find the files I a trying to exclude. Will someone help me exclude My Documents\My Music from the copying, please? Thank you.
Guest Pegasus \(MVP\) Posted July 17, 2007 Posted July 17, 2007 Re: Xcopy help please "Jack Gillis" <XXXXXXXX@widomaker.com> wrote in message news:ulV4laJyHHA.5204@TK2MSFTNGP03.phx.gbl... >I have an old fashioned batch file I use very often under XP to do a backup >of My > Documents to a USB Flash Drive. > > It contains, among other things, this statement and works just fine and > has > so for years. > > xcopy "d:\My Documents\*.*" "U:\My Documents\" /D /Y /s > > I have added many MP3 files to My Music and there is not room for them on > the USB Drive. Have tried to use the /EXCLUDE parameter tacked on to the > end of the statement but cannot get it to work. I keep getting 'parse' > error > or 'Cannot find the files I a trying to exclude. > > Will someone help me exclude My Documents\My Music from the copying, > please? > > Thank you. > > > Try this: xcopy /D /Y /s /c "d:\My Documents\*.*" "U:\My Documents\" /exclude:c:\Exclude.txt The file c:\Exclude.txt must contain the string .MP3 (and perhaps others too).
Guest Jack Gillis Posted July 17, 2007 Posted July 17, 2007 Re: Xcopy help please "Pegasus (MVP)" <I.can@fly.com> wrote in message news:%23uH5GvJyHHA.1456@TK2MSFTNGP05.phx.gbl... > > "Jack Gillis" <XXXXXXXX@widomaker.com> wrote in message > news:ulV4laJyHHA.5204@TK2MSFTNGP03.phx.gbl... >>I have an old fashioned batch file I use very often under XP to do a >>backup of My >> Documents to a USB Flash Drive. >> >> It contains, among other things, this statement and works just fine and >> has >> so for years. >> >> xcopy "d:\My Documents\*.*" "U:\My Documents\" /D /Y /s >> >> I have added many MP3 files to My Music and there is not room for them on >> the USB Drive. Have tried to use the /EXCLUDE parameter tacked on to the >> end of the statement but cannot get it to work. I keep getting 'parse' >> error >> or 'Cannot find the files I a trying to exclude. >> >> Will someone help me exclude My Documents\My Music from the copying, >> please? >> >> Thank you. >> >> >> > Try this: > > xcopy /D /Y /s /c "d:\My Documents\*.*" "U:\My Documents\" > /exclude:c:\Exclude.txt > > The file c:\Exclude.txt must contain the string .MP3 (and perhaps > others too). > Thank you very much. I didn't realize the argument for the /EXCLUDE parameter was supposed to be a file name. I misread the Xcopy /? on that point.
Guest Pegasus \(MVP\) Posted July 17, 2007 Posted July 17, 2007 Re: Xcopy help please "Jack Gillis" <XXXXXXXX@widomaker.com> wrote in message news:efjTieKyHHA.3588@TK2MSFTNGP06.phx.gbl... > > "Pegasus (MVP)" <I.can@fly.com> wrote in message > news:%23uH5GvJyHHA.1456@TK2MSFTNGP05.phx.gbl... >> >> "Jack Gillis" <XXXXXXXX@widomaker.com> wrote in message >> news:ulV4laJyHHA.5204@TK2MSFTNGP03.phx.gbl... >>>I have an old fashioned batch file I use very often under XP to do a >>>backup of My >>> Documents to a USB Flash Drive. >>> >>> It contains, among other things, this statement and works just fine and >>> has >>> so for years. >>> >>> xcopy "d:\My Documents\*.*" "U:\My Documents\" /D /Y /s >>> >>> I have added many MP3 files to My Music and there is not room for them >>> on >>> the USB Drive. Have tried to use the /EXCLUDE parameter tacked on to >>> the >>> end of the statement but cannot get it to work. I keep getting 'parse' >>> error >>> or 'Cannot find the files I a trying to exclude. >>> >>> Will someone help me exclude My Documents\My Music from the copying, >>> please? >>> >>> Thank you. >>> >>> >>> >> Try this: >> >> xcopy /D /Y /s /c "d:\My Documents\*.*" "U:\My Documents\" >> /exclude:c:\Exclude.txt >> >> The file c:\Exclude.txt must contain the string .MP3 (and perhaps >> others too). >> > > Thank you very much. I didn't realize the argument for the /EXCLUDE > parameter was supposed to be a file name. I misread the Xcopy /? on that > point. > I didn't either until I tried it myself. Thanks for the feedback.
Recommended Posts