Category : Batch File Utilities - mostly for DOS
Archive   : CHECKELA.ZIP
Filename : CHECKEL.DOC

 
Output of file : CHECKEL.DOC contained in archive : CHECKELA.ZIP
CHECKEL version 4.1 Glenn Snow

This program, CHECKEL, will allow you to find the current errorlevel
value from either the DOS prompt, or from within a batch file. I wrote
it to enable me to find the current errorlevel without going through the
endless wait for a long IF-THEN batch file. This current version works
only with DOS versions 3.1, 3.2, 3.3, and 4.0 (as far as I know) because those
are the only DOS versions I still own and therefore have access to.

The Assembly source code is provided for those who would like to see how it
works (no surprises at all). I used a couple of debuggers (and the
PC-Magazine utility called "RAMVIEW") to trace through COMMAND.COM and find
the address of the ERRORLEVEL flag, and then read this byte. I could find
no pointers to this flag at all, (also no surprise, since it is specifically
internal to each version of COMMAND.COM, and its batch file invocation
routine).

One improvement in this version (4.1) is that the errorlevel may be stored
(in a manner of speaking) into an environment variable. This is so that
you might delay whatever decision must be made to a later point in the
batch file. This is done by placing the name of the environment variable
you wish to use as "storage" after the CHECKEL command - thus:
CHECKEL ERR1
will check the current errorlevel, report it to the screen, and also save
the errorlevel as a STRING in the environment like so: ERR1=125 or whatever
the errorlevel was. Note, this is a STRING variable in the environment, since
the ENVIRONMENT is a collection of STRINGS, not numbers. If a secondary
command processor is running, only the TOPMOST errorlevel is stored in the
environment variable.

I only have tested out the environment variable stuff on DOS version 4.0, so
please let me know if it works on other versions.

If you make some improvements on this program, or have some suggestions, please
drop me a line and let me know. If I can do anything to make it more useful,
I'll be glad to do so, (assuming, of course, that I have a clue!)

Glenn Snow
999 East McKinley Avenue
Mundelein, IL 60060
(708) 566-4079 (voice)

or CompuServe 72317,2751


  3 Responses to “Category : Batch File Utilities - mostly for DOS
Archive   : CHECKELA.ZIP
Filename : CHECKEL.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/