WINCHECK.COM returns the following error levels:
Software active Error level
Windows for Workgroups 3.1 or 3.11 enhanced mode 6
Windows 3.1 or 3.11 enhanced mode 6
Windows 3.1 standard mode 5
Windows 3.0 enhanced mode 4
Windows 3.0 standard mode 3
Windows 3.0 real mode 2
MS-DOS Task Swapper 1
None of the above detected 0
Notes: WINCHECK.COM will not detect MS-DOS 5.0 or 6.0 Shell if Task Swapper
is not enabled. It will not detect the MS-DOS 4.0 Shell. If Windows and the
task swapper are both enabled, only Windows will be detected. Windows/286
and Windows/386 will likely be detected as Windows 3.0, but this has not
WINCHECK.COM is created using a DEBUG script file, which contains all
the commands you would enter from within DEBUG to create WINCHECK.COM.
To create WINCHECK.COM, follow these steps exactly:
• Create a text file called C:\WINCHECK.SCR using a text editor (for
example, Windows Notepad, EDIT, or EDLIN). This is the DEBUG script
file. C:\WINCHECK.SCR should contain exactly the following lines
(press the ENTER key after typing each line):
Note: You MUST press the ENTER key twice after the line "INT 21".
• From the drive C command prompt, enter the following command to
create the WINCHECK.COM program:
DEBUG will read and follow the instructions in the WINCHECK.SCR
file. It is recommended that you not use this command when other
programs are running or from within Windows. If WINCHECK.SCR
contains an error, DEBUG will likely not be told when to quit and you
will have to restart your system to get out. DEBUG might even be
instructed to hang your system; if this happens, reboot and examine
WINCHECK.SCR for accuracy.
A few screens of information will scroll, ending with
nnnn:015B INT 21
Writing 0005D bytes
where "nnnn" is a combination of letters and numbers, the exact
combination of which will vary. The rest should be the same as
above if WINCHECK.SCR is correct.
DEBUG will place the WINCHECK.COM file in the current directory,
which in the example above is C:\. It should be 93 bytes in size.
You can now run the WINCHECK.COM program from within a batch file to
get information about the current operating environment. Below are
three example batch files:
REM This batch file runs the MS-DOS CHKDSK /F command if and
REM only if Windows or the Swapper are not running.
IF NOT ERRORLEVEL 1 GOTO SAFE
ECHO It is not safe to run CHKDSK /F when Windows or Shell
ECHO Task Swapper is active because other programs (or Windows
ECHO itself) may be updating the disk information.
ECHO Press any key to see the current disk information, or
PAUSE CTRL+C to break out of the batch process.
REM This batch file informs the user which MS-DOS and (if any)
REM Windows version is running.
ECHO You are using:
IF ERRORLEVEL 5 GOTO WIN31
IF ERRORLEVEL 2 GOTO WIN30
IF ERRORLEVEL 1 GOTO SWAPPER
ECHO and you're running Windows 3.1.
ECHO and you're running Windows 3.0.
ECHO and you've enabled the MS-DOS Shell Task Swapper.
REM This batch file informs the user which Windows version and
REM mode (if any)is running.
IF ERRORLEVEL 0 IF NOT ERRORLEVEL 1 ECHO Nothing detected.
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 ECHO Task swapper enabled.
IF ERRORLEVEL 2 IF NOT ERRORLEVEL 3 ECHO Windows 3.0 real mode.
IF ERRORLEVEL 3 IF NOT ERRORLEVEL 4 ECHO Windows 3.0 standard mode.
IF ERRORLEVEL 4 IF NOT ERRORLEVEL 5 ECHO Windows 3.0 enhanced mode.
IF ERRORLEVEL 5 IF NOT ERRORLEVEL 6 ECHO Windows 3.1 standard mode.
IF ERRORLEVEL 6 IF NOT ERRORLEVEL 7 ECHO Windows 3.1x enhanced mode.
How WINCHECK Works
In determining the Windows version, WINCHECK assumes that either
Windows 3.0 or Windows 3.1 is running.
WINCHECK first checks if Windows 3.1 is running using Interrupt 2F,
function 160A. If Windows 3.1 is running, then CX will be set equal to
3 (for 386 enhanced mode) or 2 (for 286 standard mode). If 3.1 is not
running, WINCHECK looks for the Windows 386 memory manager
(WIN386.EXE) using Interrupt 2F function 1600. If WIN386.EXE is not
running, WINCHECK looks for WINOLDAP.MOD using Interrupt 2F, function
WINOLDAP.MOD runs non-Windows applications in real and standard
mode; in addition, Task Swapper pretends to be WINOLDAP.MOD. If
WINOLDAP.MOD is not installed, then WINCHECK gives up and returns 0.
If WINOLDAP.MOD appears to be installed, it could be Task Swapper,
real mode 3.0, or standard mode 3.0. WINCHECK uses Interrupt 2F,
function 4B02, to determine if it is Task Swapper. If it is not,
WINCHECK issues Interrupt 2F, function 1605 and checks the response.
If CX is -01, standard mode responded (and so must be running); if
not, real mode is running.
WINCHECK.COM is derived from an assembly language fragment that
determines the mode and version of Windows from an MS-DOS application.
It has been adapted for DEBUG and batch file usability. For more
information on the procedures used to detect the Windows mode and
version, query on the following word in the Microsoft Knowledge Base:
The MS-DOS Task Swapper application program interface is documented in
the "Microsoft MS-DOS Programmer's Reference," published by Microsoft
Press (ISBN 1-55615-329-5).