WINMODE                                   Fran Finnegan
Check for Windows or task switcher          version 1.0
-------------------------------------------------------

A number of DOS programs should not be run when Windows
is running. For example, CHKDSK should not be used 
with its /F switch. Other DOS programs require a 
special switch or option when run in a DOS session to
ensure that Windows does not conflict with their
operation. WINMODE provides an easy way for a batch
file to spot whether Windows is running or indeed 
whether the MS-DOS 5 task switcher, where many of the
same limitations apply, is loaded.

Format
------

    WINMODE

Inside a batch file, this sets the ERRORLEVEL to say
whether or not Windows is loaded. The following values
are returned and can be tested with the IF ERRORLEVEL
batch command:
 
    0  No Windows or Task switcher (plain DOS)

    1  DOS 5.0 Task switch is running

    2  Windows 3.xx in standard mode is running

    3  Windows 386 2.xx is running

    4  Windows 3.xx in enhanced mode is running

WINMODE normally also reports its findings to the 
screen. You can hide this message in a batch file
by redirecting the program's output to the NUL device.
For example, in the batch file use:

    WINMODE >NUL

If you're using WINMODE in a batch file just to
ensure that a program that should not be used when in
a multi-tasking situation is not accidentally run,
you need only use lines like this:

    WINMODE >NUL
    IF ERRORLEVEL 1 THEN GOTO NOGO
    ...
    command to run program
    ...
    :NOGO
    ECHO Program only available from plain DOS prompt

Of course, you can use more extensive IF ERRORLEVEL
tests to take different actions or produces different
messages as appropriate.
