On Wed, 29 May 2002, Tobias Reif wrote:

> 
> BTW, here's my current .bat file in case anyone's interested in what I'm 
> doing:
> ([OT] does anyone know how I can stop the batch script as soon as one 
> command returned an error? I just begun learning (ugly) .bat scripting.)
> 
Well, its been a few years. My somewhat rusty recollection is that after
a program executes, its exit code is available for examination in a
builtin variable named ERRORLEVEL.  You can test to see if the value in
ERRORLEVEL is >= a given no. using something like:

IF ERRORLEVEL 5 goto done

The comparison is always >=, so if you need to do something else for
an exit code of 8 (for example), you would need to make your tests
in secending order.  i.e.,

IF ERRORLEVEL 8 goto wherever
IF ERRORLEVEL 5 goto done

Hope that helps.  BTW, as an alternative to .bat files, for Win32
platforms, you may want to consider using Windows Script Hosting, as it
is much more powerful.  See:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsconwshbasics.asp

(thats supposed to be a single line, although your email software may have
broken it in two.  Take care.

Dennis