Category : Batch File Utilities - mostly for DOS
Archive   : BATDOC.ZIP
Filename : BH_1.DOC

 
Output of file : BH_1.DOC contained in archive : BATDOC.ZIP

BAT-HINT # 1

**************************************************************************

from the BATHINTS library... part of the BATPOWER CONFERENCE from:

THE PAINFRAME OPUS/FIDO 261/1004

Baltimore, Maryland 1-301-488-7461

**************************************************************************

The COMMAND command

Command.com is an executable program just like all other .com files in DOS.
Running the COMMAND command invokes a secondary command processor, using up
about 3.2Kbytes of RAM. There are three optional parameters in DOS 3.1:

/p will permanently (until reboot) load the secondary command processor
/c allows you to pass a STRING to the secondary command processor
/e sets the environment size

The /p parameter finds its greatest use when employed in the config.sys
file to expand the environment. For example:

shell=command.com /e:62 /p [DOS 3.1] or
shell=command.com /e:32768 /p [DOS 3.2 & 3.3]

will permanently expand the environment to the maximum 992-odd bytes
allowable in DOS 3.1 (62 x 16 = 992) or 32768 bytes in DOS 3.2 or 3.3. This
is very useful when long paths, many environmental variables or programs
employing user defined environmental variables (i.e. answer.com... see
BATPOWER.ARC) are used.

When COMMAND is run without any parameters, the new command processor fully
embraces the environment of the previous command processor. So expanding
the environment by issuing one of the config.sys commands shown above will
also result in an equally expanded environment in any subsequent command
processor. The environment of the second command processor is alterable,
however, through the SET command... and changes to the environment of the
secondary command processor will not affect the environment of the primary
command processor. Thus, if you normally employ a long path but
occasionally want to modify the path for a special application, you need
only enter

command
set path=[your new path]

to invoke a new path in the secondary command processor. All other
environmental variables will remain the same. To return to the original
path and command processor, just type

exit

at the DOS prompt. Your original path will be intact.

Use of COMMAND /C is very useful for calling a batch file from another
batch file. Normally, if you enter the name of a batch file from within a
batch file, the second batch file will be executed but you will be unable
to return to the first batch file. While this limitation has been overcome
in versions of DOS >3.1 (using the CALL command), many people are still
running 3.1. To call another batch file from within a batch file in DOS 3.1
enter the following line in the first batch file:

command /c batname

BATNAME.bat will be executed and will return to the next line in the
original bat file. Alternatively, you could enter

command batname


Again, BATNAME will be executed... but this time reentry into the first bat
file is accomplished with the EXIT command. The EXIT command could be
placed at the end of the second bat file or at some other location in the
second bat file executable upon a conditional statement.

*********************************************************** David Creasey............. ... ...-....1200 N81N ......................... ... ...-....1200 N81N ......................... ... ...-....1200 N81N ......................... ... ...-....1200 N81N ......................... ... ...-....1200 N81N ......................... ... ...-....1200 N81N ......................... ... ...-....1200 N81N ......................... ... ...-....1200 N81N ......................... ... ...-....1200 N81N ......................... ... ...-....1200 N81N ......................... ... ...-....1200 N81N ................

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