Category : Network Files
Archive   : NOVELFAX.ZIP
Filename : 1012852.TXT

 
Output of file : 1012852.TXT contained in archive : NOVELFAX.ZIP


FYI

(Note: The origin of this information may be internal or external to Novell.
Novell makes every effort within its means to verify this information.
However, the information provided in this document is FOR YOUR INFORMATION
ONLY. Novell makes no explicit or implied claims to the validity of this
information.)

TITLE: Testing the DOS Errorlevel
DOCUMENT ID#: FYI.P.6071
DATE: 04DEC92
PRODUCT: NetWare Lite
PRODUCT VERSION: All versions
SUPERSEDES: NA
LITE FAX DOC #: 2852

SYMPTOM

NA

ISSUE/PROBLEM

Testing the DOS Errorlevel

Programs can set a flag in the DOS environment called errorlevel. This
is usually used by the program to pass information to DOS, such as
returning a pass or fail status of the particular program. This flag can
be tested at the DOS level in the following format:

IF not ERRORLEVEL x command

þ The "not" is optional.
þ The "x" is the number to be tested.
þ The "command" is the command to be issued if this test passes.

Note: The purpose of this document is to give general information on how
to use it with NetWare Lite and not to explain all the functionality of
the DOS ERRORLEVEL flag. For further information, please consult your
DOS documentation.

NetWare Lite v1.1 has the undocumented feature of setting the errorlevel
flag. The NET command line utilities will set it according to the status
of the command. Errorlevel is set to non-zero if the command fails or
does not complete properly.

Example:

If the command NET LOGIN TOMMYJO was issued and the user TOMMYJO
failed to log in for whatever reason (entered an invalid password,
no servers were found), the DOS errorlevel would be set to non-zero.
If TOMMYJO was logged in properly, the errorlevel would be set to
zero.

The following batch file demonstrates use of this command. The batch
file will attempt to log in user MURCHMAN to the network. If MURCHMAN is
successfully logged in, the batch file will test to see if the server
MAHONEY is on the network. If it is, the LPT1 port will be captured to
the network printer LASER on server MAHONEY. Upon failing any of the
above conditions, error messages will be displayed to the user. Only
after everything has been completed will the PROGRAM application be
executed.

:LOGIN
NET LOGIN MURCHMAN
IF ERRORLEVEL 1 GOTO LOGINERR

:CAPTURE
NET SLIST MAHONEY
IF ERRORLEVEL 1 GOTO SLISTERR
NET CAPTURE LPT1 LASER MAHONEY
ECHO You are logged in to NetWare Lite and port LPT1 has been
ECHO captured to printer LASER.
PAUSE
GOTO DONE

:LOGINERR
ECHO.
ECHO You were not correctly logged into the NetWare Lite. This
ECHO program will not continue until you are correctly logged in.
GOTO LOGIN

:SLISTERR

ECHO Server MAHONEY is not currently on the network.
PAUSE

:DONE
CLS
PROGRAM


Note: The errorlevel flag is always tested at 1. Because of the way DOS
evaluates the errorlevel, all non-zero values will pass on a test of 1.

SOLUTION

NA


  3 Responses to “Category : Network Files
Archive   : NOVELFAX.ZIP
Filename : 1012852.TXT

  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/