To expand on this since MS has announced that Windows 7's internal version # is 6.2, here's the function that includes that:Code:Friend Function GetOSVersion() As String Dim strVersion As String = "Unknown" Select Case Environment.OSVersion.Platform Case PlatformID.Win32S strVersion = "Windows 3.1" Case PlatformID.Win32Windows Select Case Environment.OSVersion.Version.Minor Case 0I strVersion = "Windows 95" Case 10I If Environment.OSVersion.Version.Revision.ToString() = "2222A" Then strVersion = "Windows 98 Second Edition" Else strVersion = "Windows 98" End If Case 90I strVersion = "Windows ME" End Select Case PlatformID.Win32NT Select Case Environment.OSVersion.Version.Major Case 3I strVersion = "Windows NT 3.51" Case 4I strVersion = "Windows NT 4.0" Case 5I Select Case Environment.OSVersion.Version.Minor Case 0I strVersion = "Windows 2000" Case 1I strVersion = "Windows XP" Case 2I strVersion = "Windows 2003" End Select Case 6I Select Case Environment.OSVersion.Version.Minor Case 0I strVersion = "Windows Vista" Case 1I strVersion = "Windows 2008" Case 2I strVersion = "Windows 7" End Select End Select Case PlatformID.WinCE strVersion = "Windows CE" Case PlatformID.Unix strVersion = "Unix" End Select Return strVersion End Function




Reply With Quote