Article ID: 109723
Article Last Modified on 5/6/2003
'====================================
' Global Declarations
'====================================
Option Explicit
Declare Function GetVersion Lib "Kernel" () As Long
Function SysVersions ()
Dim ver As Long, WinVer As Long, DosVer As Long
Dim WindowsVersion As String, DosVersion As String
ver = GetVersion()
WinVer = ver And &HFFF&
WindowsVersion = Format((WinVer Mod 256) + _
((WinVer \ 256) / 100), "Fixed")
DosVer = ver \ &H10000
DosVersion = Format((DosVer \ 256) + _
((DosVer Mod 256) / 100), "Fixed")
MsgBox "Windows Version: " & WindowsVersion _
& Chr(13) & "DOS Version: " & DosVersion
End Function
Keywords: kbhowto kbprogramming KB109723