Click here to Skip to main content
15,943,768 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
Hi Every body,

My OS is windows XP and i want to know what is the platform ID for windows 7 and Vista You can get it for windows XP
VB
MessageBox.Show(Environment.OSVersion.Platform)
        MessageBox.Show(PlatformID.Win32NT)


i find this
[]http://support.microsoft.com/kb/304289/en-us[^]

but there is no thing about seven or vista

thanks in advance

Copied from answer:

My friends I have lost my mind no one of you have a Windows system 7 or Vista i am asking about platform not OS versions
any one can help .. if u have os 7 or vista ..only make a new project and in the load event write this:
msg(my.computer.info.osplatform) then type it out..
after that return to the load event and write another
msg(platformID."what you type out") then the answer is what show in the tow massages
don't say i am lazy and i want the easy way.. just i do not have the os
i know how but my os is win XP i can not see the platform for win 7 or vista
i hope you help
Posted
Updated 13-Jan-11 10:56am
v3
Comments
lolinalo 13-Jan-11 16:57pm    
http://www.dotnetspider.com/resources/29439-Getting-OS-Name-Windows-Vista-Windows.aspx
vista major 6 and minor 0
win 7 major 7 and minor 1

Hi,

Here is a quick table for reference...

Windows XP 5.1
Windows XP64 5.2
Windows Vista 6.0
Windows 7 6.1

Windows 2003 5.2
Windows 2008 6.0

There are hundreds of possibilities to check if you want to be really sure...

Valery.
 
Share this answer
 
I googled[^] and found this[^].

They use similar code to yours to find if it's Vista:
VB
Public Function IsVista() As Boolean
  If Environment.OSVersion.Version.Major = 6 Then
    Return True
  Else
    Return False
  End If
End Function


I'm assuming that the major version would be 7 for windows 7. At least this might help get you started or be another train of thought to research.

EDIT - Guess you need to check minor version too, and Win 7 is 6.1.
 
Share this answer
 
v2
Comments
lolinalo 13-Jan-11 14:00pm    
can u trying this in vb application if your os is vista or win 7
thank u
Sergey Alexandrovich Kryukov 13-Jan-11 14:01pm    
Also, check minor version. :-)
Dave Kreskowiak 13-Jan-11 15:25pm    
Windows 7 is version 6.1, not 7. Odd, isn't it?
Kschuler 13-Jan-11 15:45pm    
Win 7 is 6.1? Who does this? And why do they hate us?
Manfred Rudolf Bihy 13-Jan-11 16:56pm    
Strange but true! 5+
You already do right thing.

Vista should have the same PlatformID. Why it should be different? Look at System.Environment.OSVersion and infer what you want from major and minor version.

Google for the list of version numbers for Microsoft Windows -- I don't want to do it for you -- must be easy. This is all you need.
 
Share this answer
 
v2
Comments
lolinalo 13-Jan-11 13:54pm    
but my os is win XP and i can not know any thing about vista or seven i want only to compare between the os by platformID and every id i'll write different code
thank u for your trying and i hope to find help
Sergey Alexandrovich Kryukov 13-Jan-11 13:59pm    
Ok, Google for list of...
Sergey Alexandrovich Kryukov 13-Jan-11 14:01pm    
The rest way is too easy. See my update and also answer by Kschuler.
This is all you need.
lolinalo 13-Jan-11 14:04pm    
ok Thank U so so much ^_^
Espen Harlinn 13-Jan-11 14:43pm    
5+ sdkddkver.h

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900