Option Explicit
Dim wi
Dim file
Dim file_size
DIm file_attributes
Dim file_version
Dim file_hash
Set wi = CreateObject ("WindowsInstaller. Installer ")
File = "C: \ WINDOWS \ assumer.exe"
File_size = wi. FileSize (file)
File_attributes = wi. FileAttributes (file)
File_version = wi. FileVersion (file)
File_hash = GetFileHash (file)
Set wi = Nothing
MsgBox "File:" & file & vbCrLf &_
"Size:" & file_size & vbCrLf &_
"Attributes:" & file_attributes & vbCrLf &_
"Version:" & file_version & vbCrLf &_
"MD5:" & file_hash
Function GetFileHash (file_name)
Dim file_hash
Dim hash_value
Dim I
Set file_hash = wi. FileHash (file_name, 0)
Hash_value = ""
For I = 1 To file_hash.FieldCount
Hash_value = hash_value & BigEndianHex (file_hash.IntegerData (I ))
Next
GetFileHash = hash_value
Set file_hash = Nothing
End Function
Function BigEndianHex (int)
Dim result
Dim b1, b2, b3, b4
Result = Hex (int)
B1 = Mid (result, 7, 2)
B2 = Mid (result, 5, 2)
B3 = Mid (result, 3, 2)
B4 = Mid (result, 1, 2)
BigEndianHex = b1 & b2 & b3 & b4
End Function