home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / batutl / battutor.arc / _WHAT.REM < prev    next >
Text File  |  1983-08-29  |  6KB  |  123 lines

  1.                             Text File      _what.rem
  2.  
  3.  
  4.  
  5.                                     WHAT.COM
  6.  
  7.  
  8. The purpose of WHAT.COM is to allow a Batch File to determine  the equipment
  9. configuration on the PC.  The Batch File runs the WHAT utility with the name of
  10. the equipment parameter to be tested.  WHAT then calls the proper DOS function
  11. and returns in the errorlevel the description of the given parameter (how much
  12. memory, how many physical disks, what DOS version number, etc.).  The Batch
  13. File can then test the errorlevel parameter and make decisions based upon what
  14. equipment is present on the PC (such as warn the user of insufficient memory,
  15. the wrong display adaptor, etc).
  16.  
  17. The format of the WHAT command line is as follows:
  18.  
  19.                 WHAT  parameter
  20.  
  21. Below is a list of parameters, and the errorlevel response for each.  Only the
  22. first letter of the parameter need appear on the command line, but using the
  23. full parameter name improves readability of the Batch File code.  Parameters
  24. may be in either upper or lower case.
  25.  
  26.  
  27.          Parameter                       Returned in Errorlevel
  28.          ---------                       ----------------------
  29.  
  30.  
  31.         D or DRIVES                     Number of valid drive letters known
  32.                                         to DOS, including floppies, hard
  33.                                         disks, and virtual disks.  DOS con-
  34.                                         siders a one-drive system to have 2
  35.                                         virtual disks.
  36.  
  37.         F or FLOPPIES                   Number of physical drives set on the
  38.                                         System Board switches.  A one-drive
  39.                                         system has 1 physical disk.
  40.  
  41.         V or VIDEO                      0 if no monitor
  42.                                         1 if 40x25 mode, color adaptor
  43.                                         2 if 80x25 mode, color adaptor
  44.                                         3 if 80x25 mode, either color adaptor
  45.                                              or monochrome adaptor
  46.  
  47.         J or JOY ADAPTOR                0 if no adaptor present
  48.                                         1 if the adaptor is present
  49.                                              (NOT the number of sticks)
  50.  
  51.         P or PARALLEL PORTS             returns the number of parallel ports
  52.  
  53.         S or SERIAL PORTS               returns the number of serial ports
  54.  
  55.         K or K BLOCKS MEMORY            returns the number of 4-k blocks of
  56.                                                 memory set on the switches
  57.                                                 (4-K = 4096 bytes)
  58.  
  59.         R or RELEASE                    returns the major release of the DOS
  60.                                                 you are running.
  61.                                                 (e.g. DOS 2.0  =  2 )
  62.                                                 (  0  if earlier than 2.0)
  63.  
  64.         M or MINOR                      returns the minor release of the DOS
  65.                                                 you are running.
  66.                                                 (e.g. DOS 2.0  =  0 )
  67.  
  68.         C or CURRENT                    returns the current default disk drive
  69.                                                 (0 = A:, 1 = B:, etc )
  70.  
  71.  
  72. If the command line is empty or if the parameter does not begin with one of the
  73. above letters, an error message is printed and SLASH executes a CTRL BREAK.
  74. This is to assist in the debugging of a Batch File by allowing you to terminate
  75. the execution of the Batch File when this error is discovered.
  76.  
  77. Note the the K BLOCKS MEMORY are 4-K blocks.  This is so heavily memoried PC's
  78. can still fit their memory size into a one-byte descriptor necessary for WHAT's
  79. report to DOS.
  80.  
  81. Also note that much of the above information is obtained from the System Board
  82. Switches (such as the number of physical floppies). If your system uses one of
  83. the many disk enhancement programs that patches DOS, then the DRIVES parameter
  84. may or may not give you the correct number of "virtual drives" (all bets are
  85. off when you start patching DOS). The same goes for the video monitor setting.
  86.  
  87.  
  88.  
  89. Here are the command lines of an example.  Examine the code, and then we'll
  90. execute the example.
  91.  
  92.  
  93.  
  94.  
  95.           what floppies
  96.           if errorlevel 4 goto 4disks
  97.           if errorlevel 3 goto 3disks
  98.           if errorlevel 2 goto 2disks
  99.           if errorlevel 1 goto 1disks
  100.           slash/l/No floppies???  You're either patched or pulling my leg!
  101.           goto continue
  102.           :1disks
  103.           slash/1/One floppy.  Hmm.  One of the last of a dying breed,
  104.           slash/ /or else there's a hard disk next door.
  105.           goto continue
  106.           :2disks
  107.           slash/l/Two floppies is the mark of a mainstream user.
  108.           slash/l/Have you considered a RAM disk?  Think about it ...
  109.           slash/l/(Don't type y/n.  You're probably answering EVERYTHING
  110.           slash/ / y/n by now ! )
  111.           goto continue
  112.           :3disks
  113.           slash/l/Three floppies! Is one a RAM disk, or (gasp!) a winnie?
  114.           slash/l/(Don't type y/n.  You're probably answering EVERYTHING
  115.           slash/ / y/n by now ! )
  116.           goto continue
  117.           :4disks
  118.           slash/l/Four floppies!! A heavy duty user, for sure. Or else
  119.           slash/l/you're just fooling with the switches ...
  120.           :continue
  121.  
  122. OK, lets execute the above ...
  123.  "%1" is a place-holder for a string of characters that w