&gt;
''' &lt;param name="lRevision"&gt;Variable to set to the revision of
''' Windows.&lt;/param&gt;
''' &lt;param name="lBuildNumber"&gt;Variable to set to the build number of
''' Windows.&lt;/param&gt;
Private Sub GetWindowsVersion( _
      Optional ByRef lMajor = 0, _
      Optional ByRef lMinor = 0, _
      Optional ByRef lRevision = 0, _
      Optional ByRef lBuildNumber = 0 _
   )
Dim lR As Long
   lR = GetVersion()
   lBuildNumber = (lR And &amp;H7F000000) \ &amp;H1000000
   If (lR And &amp;H80000000