Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: question about errorlevels

0 views
Skip to first unread message

Timo Salmi

unread,
Jul 4, 2008, 2:30:56 AM7/4/08
to
... wrote:
> On your page http://www.netikka.net/tsneti/info/tscmd038.htm, at the
> bottom, you have the code
> for %%e in (0 1 2 3 4 5 6 7 8 9) do (
> if %errorlevel% EQU %%e echo The errorlevel is %%e)
>
> Is there any reason why echo The errorlevel is %errorlevel% wouldn't
> accomplish the same, even showing errorlevels above 9?

Of course. But that is not the point. The point is that one may wish to
cover a certain range or levels, and one may wish to take action
depending one the level. That is why the more involved formulation.

P.S. Thank you for the email, but I prefer Usenet news on batch/script
and other non-profession related matters. Hence I am posting my
responses, when any.

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FI-65101, Finland
Useful CMD script tricks http://www.netikka.net/tsneti/info/tscmd.htm

billious

unread,
Jul 4, 2008, 3:01:21 AM7/4/08
to

"Timo Salmi" <t...@uwasa.fi> wrote in message
news:Bsjbk.27053$_03....@reader1.news.saunalahti.fi...

Or indeed, since this is the specific NT group, why this code hasn't been
modified to

for /l %%e in (0,1,255) ...

Then there's the occasional instance where errorleve is set outside of the
traditional range..

:)

(yes - the object is to demonstrate how to USE errorlevel, not simply how to
display it)


0 new messages