'*** Does not cater for Win 2003 - Run in debug to detrmine the values to check for 2003 or later OS levels
Option Public
Option Declare
Option Compare Nocase
Private Type OS_VERSION_INFO_STRUCT
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 64 'Maintenance string for PSS usage is 128 but LMBCS is double byte
End Type
Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" _
( lpVersionInformation As OS_VERSION_INFO_STRUCT ) As Long
Function getWindowsVersion() As String
Dim session As NotesSession
Dim operatingSystem As String
Dim osVersionInfo As OS_VERSION_INFO_STRUCT
Set session = New NotesSession
If session.Platform <> "Windows/32" Then
operatingSystem = session.Platform
Else
osVersionInfo.dwOSVersionInfoSize = Len(osVersionInfo) '148
If GetVersionEx( osVersionInfo ) < 1 Then
operatingSystem = "*OS Version Error*"
Elseif osVersionInfo.dwPlatformId = 1 Then '95/98
If osVersionInfo.dwMinorVersion = 0 Then
operatingSystem = "Windows 95"
Elseif osVersionInfo.dwMinorVersion = 10 Then
operatingSystem = "Windows 98"
End If
Elseif osVersionInfo.dwPlatformId = 2 Then 'NT/2000/XP
If osVersionInfo.dwMajorVersion = 3 Then
operatingSystem = "Windows NT 3.x"
Elseif osVersionInfo.dwMajorVersion = 4 Then
operatingSystem = "Windows NT 4.0"
Elseif osVersionInfo.dwMajorVersion = 5 Then
If osVersionInfo.dwMinorVersion = 0 Then
operatingSystem = "Windows 2000"
Elseif osVersionInfo.dwMinorVersion = 1 Then
operatingSystem = "Windows XP"
End If
End If
End If
If operatingSystem = "" Then
operatingSystem = "Windows" _
& " " & Cstr(osVersionInfo.dwPlatformId) _
& "." & Cstr(osVersionInfo.dwMajorVersion) _
& "." & Cstr(osVersionInfo.dwMajorVersion)
End If
operatingSystem = operatingSystem & " " & osVersionInfo.szCSDVersion
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.