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. Database & SysAdmin
  3. System Admin
  4. Determine Windows OS????

Determine Windows OS????

Scheduled Pinned Locked Moved System Admin
sharepointsysadminhelptutorialquestion
3 Posts 3 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.
  • T Offline
    T Offline
    tmfish
    wrote on last edited by
    #1

    I am trying to determine which Windows OS is running on a machine, programmatically. I am able to get the Major Version, Minor Version, Revision, which SP, etc, etc, etc. What I am in need of is determining which version of Win2k and Win2K3 are running on machines (i.e. Win2K Pro, Win2k Server, Win2k Advanced Server, etc) :confused:. Does anyone out there have any idea on how to capture this info without interrogating a domain controller/AD or WMI (too slow)? Any help will be greatly appreciated. Mike

    M L 2 Replies Last reply
    0
    • T tmfish

      I am trying to determine which Windows OS is running on a machine, programmatically. I am able to get the Major Version, Minor Version, Revision, which SP, etc, etc, etc. What I am in need of is determining which version of Win2k and Win2K3 are running on machines (i.e. Win2K Pro, Win2k Server, Win2k Advanced Server, etc) :confused:. Does anyone out there have any idea on how to capture this info without interrogating a domain controller/AD or WMI (too slow)? Any help will be greatly appreciated. Mike

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Call GetVersionEx() and pass in an OSVERSIONINFOEX struct. The OSVERSIONINFOEX docs explain how to tell the OS versions from the various flags that get returned. --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ "That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."   -- Buffy

      1 Reply Last reply
      0
      • T tmfish

        I am trying to determine which Windows OS is running on a machine, programmatically. I am able to get the Major Version, Minor Version, Revision, which SP, etc, etc, etc. What I am in need of is determining which version of Win2k and Win2K3 are running on machines (i.e. Win2K Pro, Win2k Server, Win2k Advanced Server, etc) :confused:. Does anyone out there have any idea on how to capture this info without interrogating a domain controller/AD or WMI (too slow)? Any help will be greatly appreciated. Mike

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        This scripte is demonstrate in VBscript language. I how you could embed it in your application: Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime") strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colOperatingSystems = objWMIService.ExecQuery _ ("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colOperatingSystems Wscript.Echo "Caption: " & objOperatingSystem.Caption Next For more information try to read this article.[^]


        A thousand mile of journey, begin with the first step. APO-CEDC Save Children Norway-Cambodia Office

        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