Use:
Environment.OSVersion.ToString()
This will return values like:
"Microsoft Windows NT 5.0.2195.0"
Here is a link on how to extract the OS from the version/build numbers.
Or you can use this function:
Public Function GetOSVersion() As String
Select Case Environment.OSVersion.Platform
Case PlatformID.Win32S
Return "Win 3.1"
Case PlatformID.Win32Windows
Select Case Environment.OSVersion.Version.Minor
Case 0
Return "Win95"
Case 10
Return "Win98"
Case 90
Return "WinME"
Case Else
Return "Unknown"
End Select
Case PlatformID.Win32NT
Select Case Environment.OSVersion.Version.Major
Case 3
Return "NT 3.51"
Case 4
Return "NT 4.0"
Case 5
Select Case _
Environment.OSVersion.Version.Minor
Case 0
Return "Win2000"
Case 1
Return "WinXP"
Case 2
Return "Win2003"
End Select
Case 6
Return "Vista/Win2008Server"
Case Else
Return "Unknown"
End Select
Case PlatformID.WinCE
Return "Win CE"
End Select
End Function