Re: Sophisticated(!) copying in DOS
- From: "Pegasus \(MVP\)" <I.can@xxxxxxx>
- Date: Fri, 3 Jun 2005 01:05:52 +1000
This is a curious thread in that we keep running into two types
of problems:
- You quote generic commands that have some character
misplaced (first a colon, then a double quote), and then
you say that this was not the real command anyway.
- In spite of several encouragements, you never show us the
real command you're using.
Your latest reply is no exception: Again you do not show us what
you've done - you only report the problems.
I might add that your task is utterly trivial. I can be solved in less
than a minute by someone who pays attention to standard batch
file conventions.
Unless you agree to show us what you have written (i.e. the
verbatim contents of your batch file plus the contents of your
"exclude" file), I will stop responding in this thread. Its length
is badly out of proportion with the triviality of the problem.
There is nothing sophisticated about it!
"RJB" <notpublic@xxxxxxx> wrote in message
news:W_Ene.8790$Fb.2500@xxxxxxxxxxx
> Thanks. The .bmp attempt was to test if the exclude command was working,
and
> something was wrong with the .txt file setup.
>
> (I thought if I excluded ONE file, then I would prove that /EXCLUDE was
> working... And the .txt file was the problem. I didn't realize EXCLUDE
MUST
> be a .txt file... I thought that was only to exclude a series of files...
> For just one file of any kind, I presumed you could exclude that. Do you
> understand what I was trying?)
>
> As you can see from my first line in this reply, I am still getting the
> error... "Can't read file".
>
> And the quotes were quotes meaning, "Hey, everything between the quotes is
> what I typed for a command". I thought I only needed quotation marks on
the
> actual command line if I was using the 'long' file and path names from
> Windows rather than the traditional DOS-tastic 8 character path name.
>
> So I am still where I started.
>
> (And I don't want to copy everything and delete. Eventually, there will be
> files in the source and destination directories that are different, but
will
> have the same name! THOSE are the very files I need to exclude from
copying!
>
> I think what I may do is:
>
> MOVE \\SOURCE\Files_to_exclude.* \\SOURCE\NEWSUBDIR
> Copy \\SOURCE\*.*
> MOVE \\SOURCE\NEWSUBDIR\Files_to_exclude.* \\SOURCE
>
> and call it a day!
>
>
>
>
> "Pegasus (MVP)" <I.can@xxxxxxx> wrote in message
> news:OHPF4kxZFHA.1368@xxxxxxxxxxxxxxxxxxxxxxx
> > You need to be a little more careful with your code, especially
> > if you want to do "Sophisticated copying" (your Subject line).
> > I wrote this:
> >
> > /EXCLUDE:"\\SourceDrive\ShareDocs\dontcopy.txt"
> > "/EXCLUDE:\\Sourcedrive\Shareddocs\Mailroom\grace.bmp"
> >
> > There are two obvious problems with your code:
> > - You shifted the first quote to the beginning of the line. Makes no
sense
> > whatsoever!
> > - You quote a .bmp file after the exclude switch. On several previous
> > occasions in this thread it was pointed out that the file after the
> > /exclude switch must be a text file containing a list of files to be
> > excluded. It cannot be a .bmp file!
> >
> >
> > "RJB" <notpublic@xxxxxxx> wrote in message
> > news:SPpne.8594$Fb.2545@xxxxxxxxxxx
> >> STILL a "Can't read file
\\SOURCEDRIVE\Shareddocs\Mailroom\dontcopy.txt"
> >>
> >> I know the "path" is OK, because if I exclude the "/EXCLUDE:" line, it
> >> copies everything.
> >>
> >> Also, I tried the line with an
> >> "/EXCLUDE:\\Sourcedrive\Shareddocs\Mailroom\grace.bmp" - a picture of
my
> >> dog - and still got the "Can't read file ...grace.bmp"
> >>
> >> So, it appears to be something it's not liking about "Exclude"?
> >>
> >> Arggggghhhhh!
> >>
> >>
> >>
> >>
> >>
> >>
> >> "Pegasus (MVP)" <I.can@xxxxxxx> wrote in message
> >> news:uMW$1KjZFHA.1384@xxxxxxxxxxxxxxxxxxxxxxx
> >> > With your "path" command you wrecked your existing path! The
> >> > correct way would be to type this:
> >> >
> >> > path %path%;\\SourceDrive\ShareDocs.
> >> >
> >> > However . . . adding SourceDrive\ShareDocs to the path makes no
> >> > sense, because SourceDrive\ShareDocs contains no executable
> >> > programs. The path is used to locate executable programs, not data
> >> > files.
> >> >
> >> > Here is what you should type:
> >> >
> >> > xcopy /y "\\SOURCEDRIVE\SHAREDDOCS\MAILROOM"
> >> > /EXCLUDE:"\\SourceDrive\ShareDocs\dontcopy.txt" "C:\RECEIVE\"
> >> >
> >> > This is all one long line. Note the "/y" switch, the trailing
backslash
> >> > after "c:\Receive\", and the sets of double quotes. Depending on
> >> > your actual names, they could be essential.
> >> >
> >> >
> >> > "RJB" <notpublic@xxxxxxx> wrote in message
> >> > news:qg5ne.5780$Lb.1073@xxxxxxxxxxx
> >> >> I added
> >> >> PATH \\SOURCEDRIVE\SHAREDDOCS
> >> >>
> >> >> And now get
> >> >> 'xcopy' is not recognized as an internal or external command,
> >> >> operable program or batch file
> >> >>
> >> >> I guess I should have added %PATH% \\SOURCEDRIVE\SHAREDDOCS?
> >> >>
> >> >> btw, here is the full command in my batch file:
> >> >>
> >> >> XCOPY \\SOURCEDRIVE\SHAREDDOCS\MAILROOM /EXCLUDE:dontcopy.txt
> > C:\RECEIVE
> >> >>
> >> >> My goal is to take all of the files (save the five listed in
> >> >> "dontcopy.txt"!) and copy them from a subdirectory called "Mailroom"
> >> >> on
> >> >> my
> >> >> server to a subdirectory called "Receive" on my laptop.
> >> >>
> >> >> (The file "dontcopy.txt" is in \\SOURCEDRIVE\SHAREDDOCS\MAILROOM)
> >> >>
> >> >>
> >> >> Thanks,
> >> >>
> >> >>
> >> >>
> >> >> "Bob I" <birelan@xxxxxxxxx> wrote in message
> >> >> news:OFKA7WsYFHA.712@xxxxxxxxxxxxxxxxxxxxxxx
> >> >> > From the help
> >> >> > " /EXCLUDE:file1[+file2][+file3]...
> >> >> > Specifies a list of files containing strings. Each string should
be
> > in
> >> > a
> >> >> > separate line in the files. 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. For example, specifying a string like \obj\ or .obj
> > will
> >> >> > exclude all files underneath the directory obj or all files with
the
> >> > .obj
> >> >> > extension respectively."
> >> >> >
> >> >> > So
> >> >> > /EXCLUDE:dontcopy.txt
> >> >> > NOT
> >> >> > /EXCLUDE dontcopy.txt
> >> >> >
> >> >> > Since where you put the file resulted in "can't read xxx", I
suggest
> >> >> > putting "dontcopy.txt" in a directory that is listed in the PATH
> >> > listing.
> >> >> >
> >> >> > RJB wrote:
> >> >> >
> >> >> >> It's all listed in the screens above
> >> >> >>
> >> >> >> The donotcopy.txt contains a list - one per line - of each
exclded
> >> > file.
> >> >> >>
> >> >> >> The long and short is
> >> >> >>
> >> >> >> xcopy \\destinationpath\subdir /EXCLUDE donotcopy.txt
> >> >> >> \\receivingpath\subdirectory
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> "Pegasus (MVP)" <I.can@xxxxxxx> wrote in message
> >> >> >> news:OsRQprkYFHA.3188@xxxxxxxxxxxxxxxxxxxxxxx
> >> >> >>
> >> >> >>>Let's see your precise command, and the contents of the
> >> >> >>>exclude file.
> >> >> >>>
> >> >> >>>
> >> >> >>>"RJB" <RJB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> >> >>>news:8E2C8AD9-6297-41BA-8154-8EF2CFE8DE01@xxxxxxxxxxxxxxxx
> >> >> >>>
> >> >> >>>>I've tried every permutation I can think of, and the results I
get
> >> > are:
> >> >> >>>> Can't read file: XXX
> >> >> >>>>
> >> >> >>>> 0 File(s) copied
> >> >> >>>>
> >> >> >>>>(where XXX is whatever file comes after the "/exclude:" switch.
> >> >> >>>>
> >> >> >>>>The "donotcopy.txt" file is in the SOURCE directory, correct?
> >> >> >>>>
> >> >> >>>>Also, if I just try to exclude file(s) by name - a la
> >> > /EXCLUDE:ABC*.fil,
> >> >> >>>>I
> >> >> >>>>get the same result...
> >> >> >>>>Can't read file: ABC*.fil
> >> >> >>>>
> >> >> >>>>0 File(s) copied
> >> >> >>>>
> >> >> >>>>What the heck is going on???
> >> >> >>>>
> >> >> >>>>
> >> >> >>>>
> >> >> >>>>"Bob I" wrote:
> >> >> >>>>
> >> >> >>>>
> >> >> >>>>>BINGO! We have a Winner! :-) :-)
> >> >> >>>>>
> >> >> >>>>>RJB wrote:
> >> >> >>>>>
> >> >> >>>>>
> >> >> >>>>>>At the risk of being redundantly monotonous and obtuse:
> >> >> >>>>>>
> >> >> >>>>>>1) Create a notepad file
> >> >> >>>>>>2) In the file, type:
> >> >> >>>>>>ABC Jackson.fil
> >> >> >>>>>>ABC Smith.fil
> >> >> >>>>>>ABC Alias.fil
> >> >> >>>>>>ABC Lost.fil
> >> >> >>>>>>ABC Polar.fil
> >> >> >>>>>>3) Save it as "filelist.txt"
> >> >> >>>>>>4) In the xcopy command,
> >> >> >>>>>> XCOPY \\PATH\SOURCE_SUBDIRECTORY /EXCLUDE filelist.txt
> >> >> >>>>>>\\PATH\TARGET_SUBDIRECTORY /d /h /p /r /u /k /y
> >> >> >>>>>>
> >> >> >>>>>>Close?
> >> >> >>>>>>
> >> >> >>>>>>
> >> >> >>>>>>"Bob I" wrote:
> >> >> >>>>>>
> >> >> >>>>>>
> >> >> >>>>>>
> >> >> >>>>>>>Inline,
> >> >> >>>>>>>
> >> >> >>>>>>>RJB wrote:
> >> >> >>>>>>>
> >> >> >>>>>>>
> >> >> >>>>>>>
> >> >> >>>>>>>>Yeah, I gotta say, Pegasus, your solution gives me an ice
> >> >> >>>>>>>>cream
> >> >> >>>
> >> >> >>>headache.
> >> >> >>>
> >> >> >>>>>>>>I still don't know if I get the "file listing" info...
> >> >> >>>>>>>
> >> >> >>>>>>>>From your initial post, it seems as if I am creating a
file -
> >> > called
> >> >> >>>
> >> >> >>>"file1"
> >> >> >>>
> >> >> >>>>>>>>- and in that file it includes a list of excluded files.
> >> >> >>>>>>>
> >> >> >>>>>>>CORRECT
> >> >> >>>>>>>
> >> >> >>>>>>>
> >> >> >>>>>>>
> >> >> >>>>>>>>But I probably just want to do
> >> >> >>>>>>>>/EXCLUDE ABC*.fil
> >> >> >>>>>>>
> >> >> >>>>>>>Wrong, should be like this
> >> >> >>>>>>>
> >> >> >>>>>>>XCOPY /EXCLUDE FILELIST.TXT
> >> >> >>>>>>>
> >> >> >>>>>>>FILELIST.TXT contents are ABC*.fil
> >> >> >>>>>>>one entry per line, you may have to experiment with it a bit.
> >> >> >>>>>>>
> >> >> >>>>>>>
> >> >> >>>>>>>
> >> >> >>>>>>>>Which is what your most recent post says. Right?
> >> >> >>>>>>>
> >> >> >>>>>>>nope.
> >> >> >>>>>>>
> >> >> >>>>>>>
> >> >> >>>>>>>>Anyway, I think I have enough info to experiment with.
> >> >> >>>>>>>>
> >> >> >>>>>>>>Thanks,
> >> >> >>>>>>>>
> >> >> >>>>>>>>
> >> >> >>>>>>>
> >> >> >>>>>>>
> >> >> >>>>>
> >> >> >>>
> >> >> >>
> >> >> >>
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>
.
- Follow-Ups:
- Re: Sophisticated(!) copying in DOS
- From: RJB
- Re: Sophisticated(!) copying in DOS
- References:
- Re: Sophisticated(!) copying in DOS
- From: RJB
- Re: Sophisticated(!) copying in DOS
- From: Pegasus \(MVP\)
- Re: Sophisticated(!) copying in DOS
- From: RJB
- Re: Sophisticated(!) copying in DOS
- From: Pegasus \(MVP\)
- Re: Sophisticated(!) copying in DOS
- From: RJB
- Re: Sophisticated(!) copying in DOS
- Prev by Date: Unable to set the home page.
- Next by Date: rebooting loop after SP2
- Previous by thread: Re: Sophisticated(!) copying in DOS
- Next by thread: Re: Sophisticated(!) copying in DOS
- Index(es):
Relevant Pages
|