Function GetVersion(pathspec)
Dim fso, temp
Set fso = CreateObject("Scripting.FileSystemObject")
temp = fso.GetFileVersion(pathspec)
If Len(temp) Then
GetVersion = temp
Else
GetVersion = "无可用版本信息!"
End If
End Function
Function GetAttributes(pathspec)
Dim fso, f, temp, str
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(pathspec)
temp = f.Attributes
str = ""
If temp and 4 Then str = str & "系统"
If temp and 2 Then str = str & "隐藏"
If temp and 1 Then str = str & "只读"
If str = "" Then str = "普通"
GetAttributes = str
End Function
filepath = "C:\Windows\system32\shell32.dll"
msgbox filepath & " 的版本是 " & GetVersion(filepath)
msgbox filepath & " 的属性是 " & GetAttributes(filepath)
Last edited by qinchun36 on 2010-1-5 at 10:00 ]