Actually, your response contained the seeds of a better approach. To have
programs march on regardless of any errors that occur, is very primitive
programming practice. A program that has sufficient error handling to
analyse any problems that occur, and provide you with a log of them is far
better.
--
Jon
Accidents will happen
It cannot be denied that "Trevor" <(E-Mail Removed)> clearly stated in
news:(E-Mail Removed)...
> On Fri, 20 Oct 2006 13:09:46 +1000, "Pegasus \(MVP\)" <(E-Mail Removed)>
> wrote:
>
>>
>>"Trevor" <(E-Mail Removed)> wrote in message
>>news:(E-Mail Removed)...
>>> On Thu, 19 Oct 2006 19:03:01 -0700, Ken W
>>> <(E-Mail Removed)> wrote:
>>>
>>> >I'm creating a batch file with many different lines that use the COPY
>>command
>>> >for each line. If that line encounters an error, I want the batch file
>>> >to
>>> >continue processing the next line and not stop. Right now it stops if
>>> >it
>>> >encounters some error. How do I make it continue to the end?
>>> >
>>> You have to know what type of error it encounters. The next
>>> line should read something like "if errorlevel = ? goto next"
>>> Where "next" is the name of any entry point you want.
>>> The entry point no matter what you call it must be preceded
>>> by a :next (colon)
>>> The error could be errorlevel 0,1,2,3 etc...you need to look
>>> at cmd help or batch file help on google. You see the type of error
>>> is reported by some error level number. There are different kinds.
>>> IE. If the file already existed, or if the file didn't copy correctly,
>>> or was copying over a ready only existing file etc etc.
>>> There are hundreds and hundred of examples in google.
>>> If anything search for "file copy errorlevel" or "batch file
>>> errorlevel".
>>>
>>> Good Luck,
>>>
>>> Trev
>>
>>The OP wants the batch file to continue on an error. He
>>does not want to examine the error condition. As Pedro
>>observed, he should use the /c switch.
>>
> sorry....i thought he wanted the batch to make a decision on the
> error.
>
> guess i'll refrain from helping in the future.
>
> Good Luck,
>
> Trev
|