Page 1 of 1

Need a guaranteed way to check if user is running Vista

Posted: Thu Feb 21, 2008 8:14 pm
by Ocean
A thread in the mailing list mentions that if the systemVersion returns "NT 6.0" then the user is running Windows Vista.

However, it appears certain Windows XP Pro builds also return "NT 6.0" as the systemVersion!

Is there a better way to check for Vista?

Posted: Thu Feb 21, 2008 8:54 pm
by Garrett
You can check the registry entries under the following keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion, CurrentVersion
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion, ProductName
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion, CurrentBuildNumber
using the queryRegistry in Rev

Code: Select all

queryRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion") 
queryRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName")
queryRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber")
For a mostly correct list of windows versions and names, you can visit my old an not updated since early 2004 page at:

http://www.paraboliclogic.com/Windows_V ... mation.htm

I don't have a Vista install right now to check what informatin is given back from Vista, but I'm pretty sure that the "ProductName" will not retrun "Windows XP Home" or otherwise on a Vista system. And of course if it returns nothing, then it's likely a 95 through ME system since the reg entry path is different.

Posted: Thu Feb 21, 2008 8:54 pm
by Mark
Ocean,

Which XP Pro builds are those, exactly?

Mark

Posted: Sat Feb 23, 2008 1:15 am
by Ocean
Garrett:

Thanks for the info! We are now using the "ProductName" and it appears to work great. Vista systems return strings like this: "Windows Vista (TM) Home Premium" :)

Mark:

No idea which builds they are, but we've only received 2 reports so far and are attempting to obtain more info regarding the specific builds.