Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Finding current OS Version

Finding current OS Version

Scheduled Pinned Locked Moved C / C++ / MFC
questionsysadminwindows-adminjsonhelp
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    msr_codeproject
    wrote on last edited by
    #1

    Hi, I want to find my pc's current os version. I am using ::GetVersionEx(OSVERSIONINFO &osver) API to know. But the problem is Windows 7 and Windows Server 2008 R2 have same version number i.e., 6.1 How can i find what is the exact version (Windows 7 or Server 2008 R2)? Thanks in advance, Regards msr

    S R 2 Replies Last reply
    0
    • M msr_codeproject

      Hi, I want to find my pc's current os version. I am using ::GetVersionEx(OSVERSIONINFO &osver) API to know. But the problem is Windows 7 and Windows Server 2008 R2 have same version number i.e., 6.1 How can i find what is the exact version (Windows 7 or Server 2008 R2)? Thanks in advance, Regards msr

      S Offline
      S Offline
      ShilpiP
      wrote on last edited by
      #2

      Use OSVERSIONINFOEX, and check in MSDN Link ->[^] Windows 7 6.1 6 1 OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION Windows Server 2008 R2 6.1 6 1 OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION Version of both Windows 7 and Windows Server 2008 R2 is same but wProductType is different. I Think it will help you :)

      I believe in LOVE AT FIRST SIGHT... Bcoz I have loved my Mother... even since I opened my eyes...(ICAN)

      R 1 Reply Last reply
      0
      • M msr_codeproject

        Hi, I want to find my pc's current os version. I am using ::GetVersionEx(OSVERSIONINFO &osver) API to know. But the problem is Windows 7 and Windows Server 2008 R2 have same version number i.e., 6.1 How can i find what is the exact version (Windows 7 or Server 2008 R2)? Thanks in advance, Regards msr

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #3

        From the remarks section of OSVERSIONINFO Structure[^]:

        Operating system

        Version no.

        dwMajorVersion

        dwMinorVersion

        Other

        Windows 7

        6.1

        6

        1

        OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION

        Windows Server 2008 R2

        6.1

        6

        1

        OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

        So, you just need to check for the wProductType member of the OSVERSIONINFOEX structure that you're passing in to the API.

        "Real men drive manual transmission" - Rajesh.

        M I 2 Replies Last reply
        0
        • S ShilpiP

          Use OSVERSIONINFOEX, and check in MSDN Link ->[^] Windows 7 6.1 6 1 OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION Windows Server 2008 R2 6.1 6 1 OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION Version of both Windows 7 and Windows Server 2008 R2 is same but wProductType is different. I Think it will help you :)

          I believe in LOVE AT FIRST SIGHT... Bcoz I have loved my Mother... even since I opened my eyes...(ICAN)

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #4

          Take a 5, you gave the correct answer as well (albeit with no proper emphasis on formatting). :)

          "Real men drive manual transmission" - Rajesh.

          S 1 Reply Last reply
          0
          • R Rajesh R Subramanian

            Take a 5, you gave the correct answer as well (albeit with no proper emphasis on formatting). :)

            "Real men drive manual transmission" - Rajesh.

            S Offline
            S Offline
            ShilpiP
            wrote on last edited by
            #5

            Hummm :) Next time I will try to send answer with proper formatting and all. Thanks :)

            I believe in LOVE AT FIRST SIGHT... Bcoz I have loved my Mother... even since I opened my eyes...(ICAN)

            1 Reply Last reply
            0
            • R Rajesh R Subramanian

              From the remarks section of OSVERSIONINFO Structure[^]:

              Operating system

              Version no.

              dwMajorVersion

              dwMinorVersion

              Other

              Windows 7

              6.1

              6

              1

              OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION

              Windows Server 2008 R2

              6.1

              6

              1

              OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

              So, you just need to check for the wProductType member of the OSVERSIONINFOEX structure that you're passing in to the API.

              "Real men drive manual transmission" - Rajesh.

              M Offline
              M Offline
              msr_codeproject
              wrote on last edited by
              #6

              Shilpi Boosar and Rajesh, thank you so much. Regards msr

              modified on Saturday, February 12, 2011 12:10 AM

              1 Reply Last reply
              0
              • R Rajesh R Subramanian

                From the remarks section of OSVERSIONINFO Structure[^]:

                Operating system

                Version no.

                dwMajorVersion

                dwMinorVersion

                Other

                Windows 7

                6.1

                6

                1

                OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION

                Windows Server 2008 R2

                6.1

                6

                1

                OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION

                So, you just need to check for the wProductType member of the OSVERSIONINFOEX structure that you're passing in to the API.

                "Real men drive manual transmission" - Rajesh.

                I Offline
                I Offline
                Iain Clarke Warrior Programmer
                wrote on last edited by
                #7

                Rajesh R Subramanian wrote:

                a lot of table information

                OK, now you're just showing off! Iain.

                I am one of "those foreigners coming over here and stealing our jobs". Yay me!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups