home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
batutl
/
battutor.arc
/
_WHAT.REM
< prev
next >
Wrap
Text File
|
1983-08-29
|
6KB
|
123 lines
Text File _what.rem
WHAT.COM
The purpose of WHAT.COM is to allow a Batch File to determine the equipment
configuration on the PC. The Batch File runs the WHAT utility with the name of
the equipment parameter to be tested. WHAT then calls the proper DOS function
and returns in the errorlevel the description of the given parameter (how much
memory, how many physical disks, what DOS version number, etc.). The Batch
File can then test the errorlevel parameter and make decisions based upon what
equipment is present on the PC (such as warn the user of insufficient memory,
the wrong display adaptor, etc).
The format of the WHAT command line is as follows:
WHAT parameter
Below is a list of parameters, and the errorlevel response for each. Only the
first letter of the parameter need appear on the command line, but using the
full parameter name improves readability of the Batch File code. Parameters
may be in either upper or lower case.
Parameter Returned in Errorlevel
--------- ----------------------
D or DRIVES Number of valid drive letters known
to DOS, including floppies, hard
disks, and virtual disks. DOS con-
siders a one-drive system to have 2
virtual disks.
F or FLOPPIES Number of physical drives set on the
System Board switches. A one-drive
system has 1 physical disk.
V or VIDEO 0 if no monitor
1 if 40x25 mode, color adaptor
2 if 80x25 mode, color adaptor
3 if 80x25 mode, either color adaptor
or monochrome adaptor
J or JOY ADAPTOR 0 if no adaptor present
1 if the adaptor is present
(NOT the number of sticks)
P or PARALLEL PORTS returns the number of parallel ports
S or SERIAL PORTS returns the number of serial ports
K or K BLOCKS MEMORY returns the number of 4-k blocks of
memory set on the switches
(4-K = 4096 bytes)
R or RELEASE returns the major release of the DOS
you are running.
(e.g. DOS 2.0 = 2 )
( 0 if earlier than 2.0)
M or MINOR returns the minor release of the DOS
you are running.
(e.g. DOS 2.0 = 0 )
C or CURRENT returns the current default disk drive
(0 = A:, 1 = B:, etc )
If the command line is empty or if the parameter does not begin with one of the
above letters, an error message is printed and SLASH executes a CTRL BREAK.
This is to assist in the debugging of a Batch File by allowing you to terminate
the execution of the Batch File when this error is discovered.
Note the the K BLOCKS MEMORY are 4-K blocks. This is so heavily memoried PC's
can still fit their memory size into a one-byte descriptor necessary for WHAT's
report to DOS.
Also note that much of the above information is obtained from the System Board
Switches (such as the number of physical floppies). If your system uses one of
the many disk enhancement programs that patches DOS, then the DRIVES parameter
may or may not give you the correct number of "virtual drives" (all bets are
off when you start patching DOS). The same goes for the video monitor setting.
Here are the command lines of an example. Examine the code, and then we'll
execute the example.
what floppies
if errorlevel 4 goto 4disks
if errorlevel 3 goto 3disks
if errorlevel 2 goto 2disks
if errorlevel 1 goto 1disks
slash/l/No floppies??? You're either patched or pulling my leg!
goto continue
:1disks
slash/1/One floppy. Hmm. One of the last of a dying breed,
slash/ /or else there's a hard disk next door.
goto continue
:2disks
slash/l/Two floppies is the mark of a mainstream user.
slash/l/Have you considered a RAM disk? Think about it ...
slash/l/(Don't type y/n. You're probably answering EVERYTHING
slash/ / y/n by now ! )
goto continue
:3disks
slash/l/Three floppies! Is one a RAM disk, or (gasp!) a winnie?
slash/l/(Don't type y/n. You're probably answering EVERYTHING
slash/ / y/n by now ! )
goto continue
:4disks
slash/l/Four floppies!! A heavy duty user, for sure. Or else
slash/l/you're just fooling with the switches ...
:continue
OK, lets execute the above ...
"%1" is a place-holder for a string of characters that w