Announcement

Collapse
No announcement yet.

How to detect if program is being run under Platform 2 OS?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to detect if program is being run under Platform 2 OS?

    I have tried INT &H2F, services &H1600 & &H160A, plus I have tried
    using pbvHost, bit 8. None of them showed that my DOS program was indeed
    being run under W2K. They all showed the results that are normal
    if it is being run under pure DOS. They all worked as expected under
    my Win98SE.

    Thank you for any assistance.


    ------------------

  • #2
    IF ENVIRON$("OS") = "Windows_NT" THEN

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Comment


    • #3
      I'd UCASE$() it just to be sure, but that technique works fine for me.

      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      Lance
      mailto:[email protected]a.co.nz

      Comment


      • #4
        Thanks, guys!


        ------------------

        Comment


        • #5
          If it is of any use to you, I posted some DOS host determination code a while back: Determine OS platform and version from DOS.

          The only information I have been able to find from Microsoft on determining Windows version from a DOS application, KB article Q75338, unfortunately doesn't cover NT-class Windows.

          ------------------
          If you try to make something idiot-proof, someone will invent a better idiot.
          If you try to make something idiot-proof, someone will invent a better idiot.

          Comment


          • #6
            Clay, I know you use one or more of the PB/Windows compilers, so why not write a little Win/EXE program you can SHELL, and have it detect the OS and write it to a disk file you can read back in your DOS program?

            From PB/DOS, "SHELL winprog.exe" works fine... and it's not like speed it a concern, since it's not real likely the O/S will change during program execution....

            MCM
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              Matthew, Michael,

              Thank you for your replies and suggestions. I have found Tom's &
              Lance's technique to do the job, and I have already had in place
              the code for determining if being run under pure DOS or Platform 1
              OS's. Thank you both for your time, though.


              ------------------

              Comment

              Working...
              X