Option Explicit Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long Private Type OSVERSIONINFO dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 ' Maintenance string for PSS usage End Type Private Sub getverswindows() ' As String Dim version As String Dim GetWindowsVersion As String Dim os As OSVERSIONINFO ' receives version information Dim retval As Long ' return value os.dwOSVersionInfoSize = Len(os) ' set the size of the structure retval = GetVersionEx(os) ' read Windows's version information version = os.dwPlatformId & "." & os.dwMajorVersion & "." & os.dwMinorVersion Select Case version Case "1.4.0" Text1.Text = "Win 95" Case "1.4.10" Text1.Text = "Win 98" Case "1.4.98" Text1.Text = "Win ME" Case "2.3.51" Text1.Text = "Win NT 3" Case "2.4.0" Text1.Text = "Win NT 4" Case "2.5.0" Text1.Text = "Win 2000" Case "2.5.1" Text1.Text = "Win XP" Case "2.6.0" Text1.Text = "Win Vista" Case "2.6.1" Text1.Text = "Win Seven" Case Else Text1.Text = "Unknown" End Select End Sub