home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / opsys_.zip / OPSYS.DOC < prev    next >
Text File  |  1993-08-31  |  1KB  |  77 lines

  1. OPSYS
  2. -----
  3.  
  4. This little utility informs you about the running operating system. It is use-
  5. full to detect, if you're running DOS in a OS/2 environment or MS-DOS itself.
  6. I wrote this utility to handle the environment-settings in a common batch-file.
  7.  
  8.  
  9. HOW TO RUN OPSYS:
  10. -----------------
  11.  
  12. Just enter OPSYS (it runs under DOS as under OS/2) without any parameter. You
  13. will see the information about the environment:
  14.  
  15.    OPSYS Version 1.0
  16.  
  17.    OS-Version: 20.10, Real mode
  18.    Assuming running DOS under OS/2
  19.    Exit: 1
  20.  
  21. This output has been generated in a MDOS-Box. The value of 'Exit' means the
  22. errorlevel.
  23.  
  24.  
  25. ERRORLEVELS:
  26. ------------
  27. (The most important part of this utility...)
  28.  
  29. OS/2 Protected mode:    2
  30. OS/2 MDOS-Session:      1
  31. MS-DOS:                 0
  32.  
  33.  
  34. SAMPLE BATCH- / CMD- FILE:
  35. --------------------------
  36.  
  37.    @echo off
  38.    opsys
  39.    if errorlevel == 2 GOTO OS2
  40.    if errorlevel == 1 GOTO MDOS
  41.    if errorlevel == 0 GOTO MSDOS
  42.    
  43.    :continue
  44.    goto end
  45.  
  46.    :MSDOS
  47.    echo MS-DOS
  48.    goto continue
  49.  
  50.    :MDOS
  51.    echo MDOS
  52.    goto continue
  53.  
  54.    :OS2
  55.    echo OS/2 Protected
  56.    goto continue
  57.  
  58.    :END
  59.  
  60.  
  61. CREDITS:
  62. --------
  63.  
  64. If you want to get in touch with me (feedback is always welcome...), you can
  65. reach me at:
  66.  
  67.  
  68.    Markus Fehr, Haldenstrasse 9, CH-8302 Kloten
  69.  
  70.    Internet:   markus.fehr@mcmeier.active.ch       OR
  71.                100034,2525@compuserve.com
  72.    CompuServe: 100034,2525
  73.  
  74.  
  75.  
  76. Have fun! :-))
  77.