Determine Windows OS????
-
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
-
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
Call
GetVersionEx()
and pass in anOSVERSIONINFOEX
struct. TheOSVERSIONINFOEX
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 -
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
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