Dec 192017
 
Identifies which operating system it is run from (DOS, OS/2 DOS, or OS/2) via errorlevel.

Full Description of File


OPSYS: DOS / OS/2 Utility that informs
which Operating System is running (Either
OS/2, OS/2-MDOS, MS-DOS). Returns ERRORLEVEL!


File OPSYS_.ZIP from The Programmer’s Corner in
Category Batch Files
Identifies which operating system it is run from (DOS, OS/2 DOS, or OS/2) via errorlevel.
File Name File Size Zip Size Zip Type
FILE_ID.DIZ 130 119 deflated
OPSYS.DOC 1481 732 deflated
OPSYS.EXE 15971 10517 deflated

Download File OPSYS_.ZIP Here

Contents of the OPSYS.DOC file


OPSYS
-----

This little utility informs you about the running operating system. It is use-
full to detect, if you're running DOS in a OS/2 environment or MS-DOS itself.
I wrote this utility to handle the environment-settings in a common batch-file.


HOW TO RUN OPSYS:
-----------------

Just enter OPSYS (it runs under DOS as under OS/2) without any parameter. You
will see the information about the environment:

OPSYS Version 1.0

OS-Version: 20.10, Real mode
Assuming running DOS under OS/2
Exit: 1

This output has been generated in a MDOS-Box. The value of 'Exit' means the
errorlevel.


ERRORLEVELS:
------------
(The most important part of this utility...)

OS/2 Protected mode: 2
OS/2 MDOS-Session: 1
MS-DOS: 0


SAMPLE BATCH- / CMD- FILE:
--------------------------

@echo off
opsys
if errorlevel == 2 GOTO OS2
if errorlevel == 1 GOTO MDOS
if errorlevel == 0 GOTO MSDOS

:continue
goto end

:MSDOS
echo MS-DOS
goto continue

:MDOS
echo MDOS
goto continue

:OS2
echo OS/2 Protected
goto continue

:END


CREDITS:
--------

If you want to get in touch with me (feedback is always welcome...), you can
reach me at:


Markus Fehr, Haldenstrasse 9, CH-8302 Kloten

Internet: [email protected] OR
100034,[email protected]
CompuServe: 100034,2525



Have fun! :-))


 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)