Function GetProductVersion (sFilePath, sProgram)
Dim objShell, objFolder, objFolderItem, i
If FSO.FileExists(sFilePath & "\" & sProgram) Then
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(sFilePath)
Set objFolderItem = objFolder.ParseName(sProgram)
Dim arrHeaders(300)
For i = 0 To 300
arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
'WScript.Echo i &"- " & arrHeaders(i) & ": " & objFolder.GetDetailsOf(objFolderItem, i)
If lcase(arrHeaders(i))= "product version" Then
GetProductVersion= objFolder.GetDetailsOf(objFolderItem, i)
Exit For
End If
Next
End If
End Function
Source是一个.vbs文件的链接,可以为您获取文件版本,您可以随意使用它并使用您想要的输出。
船将所有版本的Windows,不确定许可证,非常便携,但不是exe或DLL。