WindowsVersion – The version number of the operating system

Private Type OSVERSIONINFO    dwOSVersionInfoSize As Long    dwMajorVersion As Long    dwMinorVersion As Long    dwBuildNumber As Long    dwPlatformId As Long    szCSDVersion As String * 128End TypePrivate Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" _    (lpVersionInformation As OSVERSIONINFO) As Long' Returns Version of Windows as a String' NOTE: Win95 returns "4.00", WIn98 returns "4.10"Function WindowsVersion() As String    Dim osInfo As OSVERSIONINFO    osInfo.dwOSVersionInfoSize = Len(osInfo)    GetVersionEx osInfo    WindowsVersion = osInfo.dwMajorVersion & "." & Right$("0" & Format$ _        (osInfo.dwMinorVersion), 2)End Function

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: