Public Function GetOSVersion() As String Dim sOSType As String = "" Select Case Environment.OSVersion.Platform Case PlatformID.Win32S sOSType = "Win 3.1" Case PlatformID.Win32Windows Select Case Environment.OSVersion.Version.Minor Case 0 sOSType = "Win95" Case 10 sOSType = "Win98" Case 90 sOSType = "WinME" Case Else sOSType = "Unknown" End Select Case PlatformID.Win32NT Select Case Environment.OSVersion.Version.Major Case 3 sOSType = "NT 3.51" Case 4 sOSType = "NT 4.0" Case 5 Select Case _ Environment.OSVersion.Version.Minor Case 0 sOSType = "Win2000" Case 1 sOSType = "WinXP" Case 2 sOSType = "Win2003" End Select Case 6 sOSType = "Vista" Case Else sOSType = "Unknown" End Select Case PlatformID.WinCE sOSType = "Win CE" End Select Return sOSType End Function
If GetOSVersion() = "WinXP" Then 'Computer is Windows XP End If
Last Updated on October 26, 2015