Category : Batch File Utilities - mostly for DOS
Archive   : ABFS.ZIP
Filename : ADVBAT12.TXT

 
Output of file : ADVBAT12.TXT contained in archive : ABFS.ZIP
Demonstration Sequence 2
========================

In the prior examples of CALL versus COMMAND /C, we showed that using the
CALL statement as opposed to the COMMAND/C statement to invoke another
batch file, (or program for that matter) saved a great deal of memory.

CALL has two other important properties:

1. The DOS ERRORLEVEL value is NOT reset upon exit from a module
invoked by CALL. However, SOME versions of BIOS/DOS will reset
ERRORLEVEL to ZERO on return from COMMAND /C'ed modules.


2. The SAME (One and Only) ENVIRONMENT is passed to a CALLed module,
whereas a COPY is passed to a COMMAND /C'ed module, and the COPY
is DISCARDED on return. Thus, any ENVIRONMENT changes made in
a CALLED module are available to the CALLER, while any changes
made by a COMMAND /C'ed module are LOST to the caller.

The following examples will illustrate this process, first in terms of
the ERRORLEVEL values being reset or not, and secondly, in terms of
using the ENVIRONMENT to pass "results" back to the caller, which can
not be done using COMMAND /C.





First, lets use ASK to simply set the ERRORLEVEL value within a small
batch file (CALLED.BAT), and see what happens when CALLED.BAT returns
to the caller (DEMO_2.BAT).




  3 Responses to “Category : Batch File Utilities - mostly for DOS
Archive   : ABFS.ZIP
Filename : ADVBAT12.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/