Dec 192017
 
Check for video type and sets DOS environment or errorlevel. Great for networks where workstations have different video types.
File VTP191.ZIP from The Programmer’s Corner in
Category Batch Files
Check for video type and sets DOS environment or errorlevel. Great for networks where workstations have different video types.
File Name File Size Zip Size Zip Type
README.191 1032 503 deflated
VIDTP191.DOC 51765 9293 deflated
VIDTP191.EXE 74507 28971 deflated

Download File VTP191.ZIP Here

Contents of the VIDTP191.DOC file




VIDTYPE Ver 1.91 Copyright 1991 by SERVITEK SOFTWARE.
_________________ All rights reserved.


If you find this useful, a $5 contribution would be appreciated.
Please send it to: CHANGE OF ADDRESS!

NEW ADDRESS: (OLD ADDRESS: )
SERVITEK SOFTWARE (Vince Deegan )
PO BOX 280581 (PO BOX 180114 )
Dallas, TX 75228-9181 (Dallas, TX 75218)

Thank you

For local area networks, a licensing fee is $100 per file
server.

Please refer to ORDER.FRM for a description of the license and
for ordering.

VIDTYPE is a utility that detects the type of video-adapter, row
and column mode, system type (IBM PC/XT/AT/PS2), CPU type, DOS-
version, keyboard type, disk types/sizes, and environmet space
that you are using and automatically sets up DOS environment
variables or an errorlevel that represents the description of
those equipment types. This should work with %100 clones, also.
In a DOS batch file, a DOS environment variable can be examined
when using the IF statement with the % symbol at each end of the
variable. An errorlevel can be checked when using the IF and
ERRLORLEVEL statements. NOTE: Any DOS variable can be deleted
from the DOS environment by using DOS's SET command. By typing
SET, the variable name, and the = sign, that variable will be
deleted. I.e. SET =

One good use of VIDTYPE is when you want to run applications that
give you a selection of video-driver-files or set-files and you
want to have the necessary video-driver-file or set-file chosen
automatically before calling the application. In other words,
you can write a batch file that uses the DOS-batch-language IF
statement and either the % symbol or ERRORLEVEL statement to
examine the DOS environment variable and/or errorlevel created by
VIDTYPE. Then, depending on which IF statement is true, the
batch file can copy the needed video-driver-file or set-file to
the default driver-file or set-file used by the application.

In some cases, using a DOS variable can interfere with some DOS
operations that depend on the use of the DOS environment space.
If this ever occurs with you, you can choose to refrain from
using DOS variables and, instead, use an errorlevel to detect the
type of equipment being used.

Make this choice carefully, though, since the advantage to using
a DOS variable as opposed to an errorlevel is that it only needs
to be set once and VIDTYPE only needs to be called once at the
start-up of your system, within the autoexec.bat file. The
errorlevel, on the other hand, needs to be checked immediately
after VIDTYPE is executed requiring VIDTYPE to be called in each
batch file that determines a video-driver-file or set-file for an
application. That's not all that bad, but remember also, when
using an errorlevel, your batch files can become pretty lengthy
if you are going to test for all of the possible choices of
equipment.

The use of DOS variables allows you ways of writing smaller and
more clever batch files. So my suggestion would be always to
choose the use of a DOS variable unless you have problems with
your DOS environment space, such as when using very large batch
files whose pointers are kept in the DOS environment space or
when using hardware that isn't hardware-compatible with IBM.

NOTE: THIS VERSION HAS A DIFFERENT NUMBERING SEQUENCE THAN THAT
OF VERSION 1.6 OR EARLIER VERSIONS, FOR ERRORLEVELS. IF YOU HAVE
USED THESE PREVIOUS VERSIONS OF VIDTYPE, YOU MUST MAKE THE
NECCESSARY CHANGES TO ANY OF YOUR PREVIOUS BATCH FILES THAT
DEPEND ON THESE ERRORLEVELS. ALSO, THE SYSTEM-TYPE DOS VARIABLE
CALLED "SYSTEM" (IN THESE PREVIOUS VERSIONS) HAS BEEN CHANGED TO
"SYS". YOU MAY GET A PRINTOUT OF THE NEEDED CHART BY TYPING
VIDTYPE NP > PRN.


Format: (Using DOS variables)

VIDTYPE [Variable name] [-V] [-RC] [+RC] [+S] [+P] [+SYS]
[+CPU] [+VER] [+SV] [+KBD] [+ENV] [+TENV] [+DRVA]
[+DRVB] [+DRVC] [+DRVD] [DEBUG]


Format: (Using errorlevels)

VIDTYPE [+E] [-V] [-RC] [+RC] [+P] [DEBUG]

OR VIDTYPE [+E] [+SYS] [+CPU] [DEBUG]

OR VIDTYPE [+E] [+VER] [DEBUG]

OR VIDTYPE [+E] [+KBD] [DEBUG]

OR VIDTYPE [+E] [+ENV] [DEBUG]

OR VIDTYPE [+E] [+TENV] [DEBUG]

OR VIDTYPE [+E] [+DRVA] [DEBUG]

OR VIDTYPE [+E] [+DRVB] [DEBUG]

OR VIDTYPE [+E] [+DRVC] [DEBUG]

OR VIDTYPE [+E] [+DRVD] [DEBUG]



Format: (For printout of on-line help and chart)

VIDTYPE NP > PRN
(Prints with no pause)




Variable name : This is the user-defined name that will be used
for the video-adapter DOS variable, provided
the -V option isn't used. When a video-adapter
DOS variable is used, row and column DOS
variables will automatically be created in
addition to the video-adapter variable,
provided the -RC option is not used.

-V : This option tells the program not to use video-adapter
detection at all. (The default setting is for
video-adapter detection to be used.)

-RC : This option tells the program not to use row & column
detection. Can use when video-adapter detection is
used.

+RC : This option tells the program to use row & column
detection. Can use when video-adapter detection not
used.

+E : This option tells the program to set an errorlevel
instead of setting DOS variables.

+S : This option will cause VIDTYPE to assign a shorter
description to the video-adapter DOS variable (shown in
the chart displayed in the on-line help).

+P : This option tells the program to prompt the user when a
CGA adapter is detected in order to find out whether a
multi-color monitor or single-color monitor is hooked
up.

+SYS : This option tells the program to include system
detection. If the +E isn't used, a variable called
SYS will be created with its system description.

+CPU : This option tells the program to include CPU detection.
If the +E option isn't used, a variable called CPU will
be created with its CPU description.

+VER : This option tells the program to include the DOS-version
detection. If the +E option isn't used, a variable
called _DOSVER will be created with its DOS-version
description.

+SV : This option will cause VIDTYPE to create a shorter
DOS variable for the DOS-version, called VER.

+KBD : This option tells the program to include detection for
the type keyboard used (83/84-key style, AT style,
Enhanced style). If the +E option isn't used, a
variable called KBD will be created with its
keyboard-style description.

+ENV : This option tells the program to include the DOS
environment free-space detection. If the +E option
isn't used, a variable called ENV will be created with
its free-bytes-of-environment-space description.

+TENV : This option tells the program to include the DOS
total-environment space detection. If the +E option
isn't used, a variable called TENV will be created with
its total-bytes-of-environment-space description.

+DRVA,
+DRVB,
+DRVC,
+DRVD : Either of these options tells the program to include
disk drive detection for drives A, B, C, and/or D. If
the +E option isn''t used, then, depending on the
option(s) used, a combination of variables called A, B,
C, and/or D are created with the drive type/size
description for each.


========== DETECTION PRIORITY WHEN USING ERRORLEVELS ============

Priority, here, means the ability of an option to overide or
over-power other options. An option of higher priority will
cut off the use of options in lower priorities when using
errorlevels (the +E option). (+S and +SV are ignored with
errorlevels.)

1st(highest) priority option(s) : DRVA
2nd priority option(s) : DRVB
3rd priority option(s) : DRVC
4th priority option(s) : DRVD
5th priority option(s) : TENV
6th priority option(s) : ENV
7th priority option(s) : KBD
8th priority option(s) : VER
9th priority option(s) : SYS, CPU
10th(lowest) priority option(s) : Variable name, -V, -RC, +RC,
+P



========== DETECTION PRECEDENCE WHEN USING VARIABLES ============

Precedence, here, means which options will be done first. A
variable of higher precedence will be set before a variable of
lower precedence. Therefore, if there's not enough environment
space left for all of the variables desired, those of the
lowest precedence will usually be the ones to lose their
chance of being used.

1st(highest) precedence option(s) : Variable name, -V, +S, +P
2nd precedence option(s) : -RC, +RC
3th precedence option(s) : +SYS, +CPU
4th precedence option(s) : +VER, +SV
5th precedence option(s) : +KBD
6th precedence option(s) : +ENV
7th precedence option(s) : +TENV
8th precedence option(s) : +DRVA
9th precedence option(s) : +DRVB
10th precedence option(s) : +DRVC
11th(lowest) precedence option(s) : +DRVD



==================== SOME DETECTION EXAMPLES ====================

-----------------------
VIDEO-ADAPTER DETECTION:
-----------------------

Say you want to call Lotus 123 where the default set-file is
called 123.SET and your set-file for using a CGA video-adapter is
called CGACOLOR.SET . . .


--------------------------------------------------
EXAMPLE for using a DOS variable for video-adapter:
--------------------------------------------------

- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the video-adapter type:

VIDTYPE VIDEO

VIDTYPE will create a DOS environment variable called
VIDEO and give it a string value that describes the type
of video-adapter your system is using, according to the
VIDTYPE chart. (Get a printout of the chart by typing
VIDTYPE NP > PRN.) It will also create two other DOS
variables called ROW and COL that give the current number
of rows and columns being used, respectively.



- Now you can write another batch file to use for calling Lotus
123.

Example: IF %VIDEO% == CGACOLOR COPY CGACOLOR.SET 123.SET
IF %VIDEO% . . . . . . .
IF %VIDEO% . . . . . . .
123

This calls Lotus 123 after copying the needed set-file to
the default set-file.

OR if your application can be called along with the name
of the desired set-file (or driver-file) you can be more
clever in your batch file.

Example: 123 %VIDEO%

This calls Lotus 123 and tells it to use the string value
in the VIDEO variable as the actual set-file name to be
used. I.e. If VIDEO has the string value CGACOLOR, Lotus,
which assumes that the file name has .SET as its
extension, will use CGACOLOR.SET as its set-file.

NOTE: If the +S option was used, the string would have
been CGA instead of CGACOLOR. This could let the variable
serve as a prefix to a file-name. I.e. If you had a
set-file called CGA123.SET, you could type 123 %VIDEO%123
which would be translated as 123 CGA123.SET.

NOTE: If you need to know the current row and column mode
that the system is using, just access the ROW and COL
variables in the same way you accessed the VIDEO variable;
i.e. IF %ROW% == . . . .
IF %COL% == . . . .


NOTE: I have found that if you are using one of the many DOS
shell programs available, you may encounter a problem when
running a batch file that tries to access the DOS variables,
while in the DOS shell program. It may not recognize these
variables as part of the "current" DOS environment since the
variables are in the "master" environment. This problem can be
solved by not running the batch file while in the DOS shell
program. Just run it out in plain ole DOS (the "master"
environment). Also, I am currently working on a way to
overcome that problem and, if successful, will include the
remedy in one of the future versions.

NOTE: The % symbol or the ERRORLEVEL statement, when used with
the IF statement, will not work right when used directly at the
DOS prompt. You must use them in a batch file.


-------------------------------------------------
EXAMPLE for using an errorlevel for video-adapter:
-------------------------------------------------

- You can write a batch file to use for calling Lotus 123 where
VIDTYPE is called earlier in the same batch file instead of
in your autoexec.bat file:

VIDTYPE +E

- VIDTYPE will abstain from using variables for the
video-adapter/row/col detection and will instead create an
errlorlevel value that describes the type of video-adapter
and row/col mode your system is using, according to the
VIDTYPE chart. (Get a printout of the chart by typing
VIDTYPE NP > PRN.)

- Then, the remaining lines in your batch file could look
like this:

IF NOT ERRORLEVEL 3 GOTO 2
COPY CGACOLOR.SET 123.SET
GOTO GO
:2
IF NOT ERRORLEVEL 2 GOTO 1
COPY . . . . .
GOTO GO
:1
IF NOT ERRORLEVEL 1 GOTO GO
COPY . . . . .
:GO
123

- This calls Lotus 123 after copying the needed set-file to
the default set-file.

- OR if your application can be called along with the name of
the desired set-file (or driver-file) your batch file could
look like this:

IF NOT ERRORLEVEL 3 GOTO 2
123 CGACOLOR
GOTO END
:2
IF NOT ERRORLEVEL 2 GOTO 1
123 . . . .
GOTO END
:1
IF NOT ERRORLEVEL 1 GOTO END
123 . . . .
:END

- This calls Lotus 123 after testing the errorlevel and tells
it to use the actual set-file name to be used. So, if
ERRORLEVEL is 3, then, according to the VIDTYPE chart, the
video equipment being used is CGA color. Lotus, which
assumes that the file name has .SET as its extension, will
use CGACOLOR.SET as its set-file.

NOTE: If the row/col mode is anything other than the standard
25 by 80 mode, the errorlevels will be different for each of
the above video-adapter types. Please refer to the VIDTYPE
chart.

NOTE: On testing errorlevels in a batch file, test in
descending order from highest to lowest and when one is
found, avoid testing the rest of the IF ERRORLEVEL statements
because they, too, will be found to be true. The reason for
this is that when an errorlevel is set in DOS, what is
actually being reported, is that the errorlevel value is the
highest errorlevel to be found. So all ERRORLEVEL values
lower than that will be true, also. Therefore, be prepared
to use the GOTO statement a lot when testing a series of
errorlevels.


-------------------------------------------
PROMPTED MONITOR DETECTION FOR CGA ADAPTERS:
-------------------------------------------

Since there is no known way of detecting the actual type of
monitor hooked up to your adapter, multi-color monitors and
single-color monitors are not automatically distinguished. So
the need for user prompting is evident when the monitor type
needs to be known. Currently, the program only has the option
to prompt at CGA adapter detection.

One use is when you have a CGA adapter that fails to produce
legible text on a single-color monitor and you need to call
MODE BW80 for black and white mode. In that situation, do the
following:

1. When you are prompted, respond with an "S", showing that
you have a single-color monitor.

2. Any time later, when accessing the video-adapter
variable, it will reveal that you have a single-color
monitor.

3. With this information, your batch file can call MODE
BW80 and set the system to black and white mode.


------------------------------------------------------------
EXAMPLE for using a DOS variable for video-adapter type with
prompting:
------------------------------------------------------------


- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the video-adapter type and to prompt the user
whenever a CGA adapter is detected:

VIDTYPE VIDEO +P

VIDTYPE will create a DOS environment variable called
VIDEO and give it a string value that describes the type
of video-adapter your system is using, according to the
VIDTYPE chart. If a CGA adapter is detected, it will
prompt the user to give the monitor type that is hooked up
to the adapter: i.e.

(M)ULTI COLOR MONITOR
(S)INGLE COLOR MONITOR

WHICH TYPE OF MONITOR DO YOU HAVE? >

and will set the video-adapter variable accordingly.
Refer to the VIDTYPE chart. (Get a printout of the chart
by typing VIDTYPE NP > PRN.) VIDTYPE will also create two
other DOS variables called ROW and COL that give the
current number of rows and columns being used,
respectively.

---------------------------------------------------------
EXAMPLE for using an errorlevel with prompting and no DOS
variables:
---------------------------------------------------------

- You can write a batch file to use for calling Lotus 123 where
VIDTYPE is called earlier in the same batch file instead of
in your autoexec.bat file:

VIDTYPE +P +E

- VIDTYPE will abstain from using variables for the
video-adapter/row/col detection and will instead create an
errlorlevel value that describes the type of video-adapter
and row/col mode your system is using, according to the
VIDTYPE chart. (Get a printout of the chart by typing
VIDTYPE NP > PRN.) If a CGA adapter is detected, it will
prompt the user to give the monitor type that is hooked up
to the adapter: i.e.

(M)ULTI COLOR MONITOR
(S)INGLE COLOR MONITOR

WHICH TYPE OF MONITOR DO YOU HAVE? >

and will alter the errorlevel accordingly. Refer to the
VIDTYPE chart.


----------------
SYSTEM DETECTION:
----------------

------------------------------------------------
EXAMPLE for using a DOS variable for system type:
------------------------------------------------

- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the system type:

VIDTYPE +SYS

VIDTYPE will create a pre-designated DOS environment
variable called SYS and give it a string value that
describes the type of system you are using, according to
the VIDTYPE chart. If no known system type is detected,
the actual number(s) found in the memory address of the
machine is given to the variable. (Get a printout of the
chart by typing VIDTYPE NP > PRN.)

----------------------------------------------------------
EXAMPLE for using an errorlevel for system type and no DOS
variables:
----------------------------------------------------------

- You can write a batch file where VIDTYPE is called just
before calling your application in order to detect the system
type. NOTE: When using the errorlevel option, system
detection will not allow for other detections of lower
priority, simultaneously. In order to get the other
detections, you must call VIDTYPE separately for them.
Suggested examples for this are in the example section later
in this document.

VIDTYPE +SYS +E

- VIDTYPE will abstain from using video-adapter/row/col
detection at all and will create an errlorlevel value that
describes the type of system you are using, according to
the VIDTYPE chart. If no known system type is detected,
the number 17 is given as the errorlevel value. (Get a
printout of the chart by typing VIDTYPE NP > PRN.)


-------------
CPU DETECTION:
-------------

---------------------------------------------
EXAMPLE for using a DOS variable for CPU type:
---------------------------------------------

- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the CPU type:

VIDTYPE +CPU

VIDTYPE will create a pre-designated DOS environment
variable called CPU and give it a string value that
describes the type of CPU you are using, according to the
VIDTYPE chart. If no known CPU type is detected, the
actual number found in the memory address of the machine
is given to the variable. (Get a printout of the chart by
typing VIDTYPE NP > PRN.)

-------------------------------------------------------
EXAMPLE for using an errorlevel for CPU type and no DOS
variables:
-------------------------------------------------------

- You can write a batch file where VIDTYPE is called just
before calling your application in order to detect the CPU
type. NOTE: When using the errorlevel option, CPU detection
will not allow for other detections of lower priority,
simultaneously. In order to get the other detections, you
must call VIDTYPE separately for them. Suggested examples
for this are in the example section later in this document.

VIDTYPE +CPU +E

- VIDTYPE will abstain from using video-adapter/row/col
detection at all and will create an errlorlevel value that
describes the type of CPU you are using, according to the
VIDTYPE chart. If no known CPU type is detected, the
number 120 is added to the errorlevel value. (Get a
printout of the chart by typing VIDTYPE NP > PRN.)


---------------------
DOS-VERSION DETECTION:
---------------------

------------------------------------------------
EXAMPLE for using a DOS variable for DOS-version:
------------------------------------------------

- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the DOS-version:

VIDTYPE +VER

VIDTYPE will create a pre-designated DOS environment
variable called _DOSVER and give it a string value that
describes the DOS-version you are using, according to the
VIDTYPE chart. (Get a printout of the chart by typing
VIDTYPE NP > PRN.)

OR

VIDTYPE +VER +SV

VIDTYPE will create a shorter pre-designated DOS
environment variable called VER and give it a string value
that describes the DOS-version you are using, according to
the VIDTYPE chart. (Get a printout of the chart by typing
VIDTYPE NP > PRN.)

-------------------------------------------------------
EXAMPLE for using an errorlevel for DOS-version and no
DOS variables:
-------------------------------------------------------

- You can write a batch file where VIDTYPE is called just
before calling your application in order to detect the DOS
version. NOTE: When using the errorlevel option, DOS-version
detection will not allow for other detections of lower
priority, simultaneously. In order to get the other
detections, you must call VIDTYPE separately for them.
Suggested examples for this are in the example section later
in this document.

VIDTYPE +VER +E

- VIDTYPE will abstain from using any other detection and
will create an errlorlevel value that describes the DOS
version being used according to the VIDTYPE chart. (Get a
printout of the chart by typing VIDTYPE NP > PRN.)


-----------------------
KEYBOARD TYPE DETECTION:
-----------------------

--------------------------------------------------
EXAMPLE for using a DOS variable for keyboard type:
--------------------------------------------------

- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the keyboard type:

VIDTYPE +KBD

VIDTYPE will create a pre-designated DOS environment
variable called KBD and give it a string value that
describes the keyboard type you are using, according to
the VIDTYPE chart. (Get a printout of the chart by typing
VIDTYPE NP > PRN.)

-----------------------------------------------------
EXAMPLE for using an errorlevel for keyboard type and
no DOS variables:
-----------------------------------------------------

- You can write a batch file where VIDTYPE is called just
before calling your application in order to detect the
keyboard type used. NOTE: When using the errorlevel option,
keyboard type detection will not allow for other detections
of lower priority, simultaneously. In order to get the
other detections, you must call VIDTYPE separately for them.
Suggested examples for this are in the example section later
in this document.

VIDTYPE +KBD +E

- VIDTYPE will abstain from using any other detection and
will create an errlorlevel value that describes the
keyboard type being used according to the VIDTYPE chart.
(Get a printout of the chart by typing VIDTYPE NP > PRN.)


--------------------------------
ENVIRONMENT FREE-SPACE DETECTION:
--------------------------------

-----------------------------------------------------------
EXAMPLE for using a DOS variable for free environment space:
-----------------------------------------------------------

- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the free environment space:

VIDTYPE +ENV

VIDTYPE will create a pre-designated DOS environment
variable called ENV and give it a string value that
describes the free bytes of environment space, according
to the VIDTYPE chart. (Get a printout of the chart by
typing VIDTYPE NP > PRN.)

----------------------------------------------------------
EXAMPLE for using an errorlevel for free environment space
and no DOS variables:
----------------------------------------------------------

- You can write a batch file where VIDTYPE is called just
before calling your application in order to detect the free
environment space. NOTE: When using the errorlevel option,
environment space detection will not allow for other
detections of lower priority, simultaneously. In order to
get the other detections, you must call VIDTYPE separately
for them. Suggested examples for this are in the example
section later in this document.

VIDTYPE +ENV +E

- VIDTYPE will abstain from using any other detection and
will create an errlorlevel value that describes the free
bytes of environment space according to the VIDTYPE chart.
(Get a printout of the chart by typing VIDTYPE NP > PRN.)


---------------------------------
ENVIRONMENT TOTAL-SPACE DETECTION:
---------------------------------

------------------------------------------------------------
EXAMPLE for using a DOS variable for total environment space:
------------------------------------------------------------

- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up a DOS environment variable that holds a
description of the total environment space:

VIDTYPE +TENV

VIDTYPE will create a pre-designated DOS environment
variable called TENV and give it a string value that
describes the total bytes of environment space, according
to the VIDTYPE chart. (Get a printout of the chart by
typing VIDTYPE NP > PRN.)

-----------------------------------------------------------
EXAMPLE for using an errorlevel for total environment space
and no DOS variables:
-----------------------------------------------------------

- You can write a batch file where VIDTYPE is called just
before calling your application in order to detect the total
environment space. NOTE: When using the errorlevel option,
total environment space detection will not allow for other
detections of lower priority, simultaneously. In order to
get the other detections, you must call VIDTYPE separately
for them. Suggested examples for this are in the example
section later in this document.

VIDTYPE +TENV +E

- VIDTYPE will abstain from using any other detection and
will create an errlorlevel value that describes the total
bytes of environment space according to the VIDTYPE chart.
(Get a printout of the chart by typing VIDTYPE NP > PRN.)


------------------------------
DISK DRIVE TYPE/SIZE DETECTION:
------------------------------

----------------------------------------------------
EXAMPLE for using DOS variables for disk types/sizes:
----------------------------------------------------

- Insert a line in your autoexec.bat file which calls VIDTYPE
in order to set up DOS environment variables that hold
descriptions of the disk drive types and sizes:

VIDTYPE +DRVA [+DRVB] [+DRVC] [+DRVD]

VIDTYPE will create pre-designated DOS environment
variable(s) called A, B, C, and/or D and give
it/them string values that describe the disk drive
types and sizes, according to the VIDTYPE chart.
(Get a printout of the chart by typing VIDTYPE NP >
PRN.)

---------------------------------------------------------
EXAMPLE for using an errorlevel for the disk drive types/
sizes and no DOS variables:
---------------------------------------------------------

- You can write a batch file where VIDTYPE is called just
before calling your application in order to detect the disk
drive types/sizes. NOTE: When using the errorlevel option,
disk drive type/size detection will not allow for other
detections of lower priority, simultaneously. In order to
get the other detections, you must call VIDTYPE separately
for them. Suggested examples for this are in the example
section later in this document.

VIDTYPE +DRVA +E

OR VIDTYPE +DRVB +E

OR VIDTYPE +DRVC +E

OR VIDTYPE +DRVD +E

- VIDTYPE will abstain from using any other detection
and will create an errlorlevel value that describes
the disk drive type & size for one, only, of drive
A, B, C, or D, according to the VIDTYPE chart. (Get
a printout of the chart by typing VIDTYPE NP > PRN.)







-----------------------------------------
COMBINATIONS OF SOME OF THE ABOVE OPTIONS:
-----------------------------------------

--------
EXAMPLES:
--------

VIDTYPE VID +S +P Creates a video-adapter DOS
variable, called VID, and
gives a shortened description
string to it. And if it
detects a CGA adapter, it will
prompt the user for the
monitor type and alter the
vide-adapter string
accordingly. Two other
variables, ROW and COL, will
be created, too, with their
row and column values.

VIDTYPE VIDEO -RC Creates a video-adapter DOS
variable, called VIDEO, giving
the standard long description
string to it. The two
variables, ROW and COL, will
not be created.


VIDTYPE +SYS Refrains from using
video-adapter/row/col
variables and only creates the
DOS variable, SYS, with a
description of the type system
being used.

VIDTYPE +E Refrains from using variables
for the video-adapter/row/col
detection and sets an
errorlevel instead, for the
video-adapter type and row &
col mode.

VIDTYPE +E +P Refrains from using variables
for the video-adapter/row/col
detection, sets an errorlevel
instead, for video-adapter
type and row/col mode, and if
a CGA adapter is detected, it
prompts the user for the
monitor type used and alters
the errorlevel accordingly.

VIDTYPE -V +RC +E Only creates an errorlevel for
the row & col mode. No
video-adapter detection is
used since the -V option was
given.

VIDTYPE +SYS +CPU Refrains from using
video-adapter/row/col
detection and creates the
variable, SYS, with a
description of the type system
being used and the variable
CPU, with a description of the
type CPU being used.

VIDTYPE VID +S -RC +CPU Creates a video-adapter DOS
variable, called VID, giving a
shortened description string
to it. It refrains from
creating the two other
variables, ROW and COL
variables, since the -RC turns
that capability off (useful
for saving environment space).
It also creates the variable,
CPU, with a description of the
type CPU being used.

VIDTYPE +RC Only creates the DOS
variables, ROW & COL, with a
description of the row &
column mode being used. No
video-adapter variable is
created since no variable name
was given.

VIDTYPE VID +S +CPU +VER Creates a video-adapter DOS
variable, called VID, giving a
shortened description string
to it. Two other variables,
ROW and COL, will be created,
too, with their row and column
values. It also creates the
variable, CPU, with a
description of the type CPU
being used. Finally, it
creates the variable, _DOSVER,
with a description of the DOS
version being used.

VIDTYPE +VER +SV +TENV Creates a shortened DOS-
version DOS variable, called
VER, with a description of the
DOS-version being used. It
also creates the variable,
TENV, with a description of
the total bytes for the master
DOS environment.

VIDTYPE +DRVA +DRVB +DRVC Creates the DOS variables, A, B,
& C with the descriptions of the
disk drive type & size for each
of those drives. No
video-adapter variable is
created since no variable name
was given.

VIDTYPE +ENV +E Refrains from using any
other type of detection and
sets an errorlevel for the
free bytes of environment
space.

VIDTYPE +KBD +E Refrains from using any
other type of detection and
sets an errorlevel for the
type of keyboard used.

VIDTYPE +DRVA +E Refrains from using any
other type of detection and
sets an errorlevel for the
drive type & size for drive
A:.


----------------------------------------------------------
WHEN USING ERRORLEVELS, THE FOLLOWING COMBINATIONS ARE NOT
ALLOWED :
----------------------------------------------------------

VIDTYPE +E +SYS (and/or) Attempted errorlevel for system
+CPU (with any detection and/or CPU detection
other option) while using other detections.

VIDTYPE +E +VER (with Attempted errorlevel for DOS
any other version detection while using
option) other detections.

VIDTYPE +E +KBD (with Attempted errorlevel for keyboard
any other detection while using other
option) detections.

VIDTYPE +E +ENV (with Attempted errorlevel for DOS
any other environment free-space detection
option) while using other detections.

VIDTYPE +E +TENV (with Attempted errorlevel for DOS
any other total environment space detection
option) while using other detections.

VIDTYPE +E +DRVA (with Attempted errorlevel for disk
any other A-drive type/size detection while
option) using other detections.

VIDTYPE +E +DRVB (with Attempted errorlevel for disk
any other B-drive type/size detection while
option) using other detections.

VIDTYPE +E +DRVC (with Attempted errorlevel for disk
any other C-drive type/size detection while
option) using other detections.

VIDTYPE +E +DRVD (with Attempted errorlevel for disk
any other D-drive type/size detection while
option) using other detections.


REASON: Because of the range limitations for DOS errorlevels
(255 max), VIDTYPE will refrain from setting errorlevels
higher than 255. If VIDTYPE allowed a large variety of
detection options for errorlevel use, their would be so many
possible permutations that the resulting errorlevel could be
a value of several thousand and DOS "IF ERRORLEVEL"
statements do not work correctly with errorlevel values
higher than 255.

ULTIMATE REMEDY: When using errorlevels, the suggested way
to get the desired detection combinations above, since you
can't do them all simultaneously, is to do the following:
Say you want to get video-adapter, row/col, system, and CPU
detection. Write this in your batch file:

1. Call VIDTYPE, using the errorlevel option, alone, for
video-adapter/row/col detection, only.
I.e. VIDTYPE +E

2. Test the errorlevels for the different
video-adapter/row/col combinations.
I.e. IF ERRORLEVEL 3 ...
IF ERRORLEVEL 2 ...

3. At the successful test, call another batch file, with a
parameter, to test for the other desired detections.
I.e. IF ERRORLEVEL 3 CALL OTHER.BAT 3
IF ERRORLEVEL 2 CALL OTHER.BAT 2

4. The other batch file could look like this:

rem ** OTHER.BAT **
VIDTYPE +E +SYS +CPU
IF ERRORLEVEL 95 IF %1 == 3 ECHO AT(8+ MHZ) 386 CGA 80x25
IF ERRORLEVEL 95 IF %1 == 2 ECHO AT(8+ MHZ) 386 MONO 80x25
IF ERRORLEVEL 64 IF %1 == 3 ECHO AT(6 MHZ)85 286 CGA 80x25
IF ERRORLEVEL 64 IF %1 == 2 ECHO AT(6 MHZ)85 286 MONO 80x25
(and so on)

The same concept applies for the +VER, +KBD, +ENV, +TENV,
and +DRV options. You may possibly need a total of up to
five batch files, depending on how large a variety of
errorlevel detections are desired.


===================================================================

There are some applications that contain automatic video-adapter
and system detection for their own use, but since this is not the
case for many applications, VIDTYPE becomes a very desirable
utility, especially in a network environment that has different
types of video equipment, system types, CPUs, DOS-versions,
keyboards, and drives among its PC workstations.

To get an on-screen chart of type descriptions and more how-to
details, VIDTYPE will display some information of its own. Just
type VIDTYPE (without any parameters).

Thanks for using VIDTYPE,
Vince Deegan, SERVITEK SOFTWARE

========================= VERSION HISTORY =========================

Version 1.0
- Had the ability to set the DOS variable and the option of
displaying debugging information with the optional DEBUG
parameter.

Version 1.1
- Added the ability to set a DOS errorlevel and two more
parameter options: +E and -V for turning on the errorlevel
mechanism and for turning off the video-adapter detection
mechanism, respectively. This addition was derived from the
suggestion of Cris Moore.

Version 1.2
- Added the ability to opt for a shorter string length to the
description assigned to the DOS variable; the +S option.
Corrected a bug in detection of Hercules cards.

Version 1.3
- Correction on use with autoexec.bat files, where error messages
occured, displaying that batch file information was lost.

Version 1.4
- Added options for detecting the current row/col mode, the
system type, and user-prompt for monitor type with CGA
adapters.

Version 1.5
- Added option for detecting the CPU type and changed numbering
sequence for errorlevels. Also added option for enabling or
disabling row and column variables when more evnironment space
is needed.

Version 1.6
- Attempted to correct an errorlevel bug without success. Made
some miscellaneous changes.

Version 1.7
- Next attempt to correct the errorlevel bug. Added options
for detecting DOS-version, free environment space, and keyboard
type.

Version 1.8
- Changed default DOS-version variable to _DOSVER and added
option for shortening the variable to VER. Also added
detection for total environment space.

Version 1.81
- Small aesthetic change and slight cutting of stack overhead.

Version 1.9
- Added detection for disk drive types and sizes.

Version 1.91
- Corrected error in detection of high density 5.25" floppies.


 December 19, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)