Try this;
Code:
Private Declare Function GetFileVersionInfoSize Lib "Version.dll" Alias "GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Private Declare Function GetFileVersionInfo Lib "Version.dll" Alias "GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwHandle As Long, ByVal dwLen As Long, lpData As Any) As Long
Private Declare Function VerQueryValue Lib "Version.dll" Alias "VerQueryValueA" (pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As Any, nVerSize As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Type VS_FIXEDFILEINFO
dwSignature As Long
dwStrucVersion As Long
dwFileVersionMS As Long
dwFileVersionLS As Long
dwProductVersionMS As Long
dwProductVersionLS As Long
dwFileFlagsMask As Long
dwFileFlags As Long
dwFileOS As Long
dwFileType As Long
dwFileSubtype As Long
dwFileDateMS As Long
dwFileDateLS As Long
End Type
Function GetFileVersion(sFileName As String) As String
Dim FI As VS_FIXEDFILEINFO
Dim sBuffer() As Byte
Dim nBufferSize As Long
Dim lpBuffer As Long
Dim nVerSize As Long
Dim nUnused As Long
Dim tmpVer As String
nBufferSize = GetFileVersionInfoSize(sFileName, nUnused)
If nBufferSize > 0 Then
ReDim sBuffer(nBufferSize)
Call GetFileVersionInfo(sFileName, 0&, nBufferSize, sBuffer(0))
Call VerQueryValue(sBuffer(0), "\", lpBuffer, nVerSize)
Call CopyMemory(FI, ByVal lpBuffer, Len(FI))
tmpVer = Format$(HiWord(FI.dwFileVersionMS)) & "." & Format$(LoWord(FI.dwFileVersionMS), "0")
If FI.dwFileVersionLS > 0 Then
tmpVer = tmpVer & "." & Format$(FI.dwFileVersionLS, "000")
End If
End If
GetFileVersion = tmpVer
End Function
Private Function HiWord(dw As Long) As Long
If (dw And &H80000000) Then HiWord = ((dw \ 65535) - 1) Else HiWord = (dw \ 65535)
End Function
Private Function LoWord(dw As Long) As Long
If (dw And &H8000&) Then LoWord = (&H8000 Or (dw And &H7FFF&)) Else LoWord = (dw And &HFFFF&)
End Function
This will return a string of the file version... eg 1.2.002