通过命令行获取Infotip

时间:2016-12-21 20:55:01

标签: python windows powershell command-line

如何以编程方式获取Win7中特定exe文件的Infotip数据?

我指的是在Windows资源管理器中悬停在文件名上时看到的弹出框。

1 个答案:

答案 0 :(得分:2)

以下是从System.Diagnostics.FileVersionInfoGet-ChildItem提取数据的示例脚本:

$path = "C:\example\file.exe"
$versioninfo = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($path)
$itemproperties= get-childitem $path
[pscustomobject]@{
    "File Description" = $versioninfo.FileDescription
    Company = $versioninfo.CompanyName
    "File version" = $versioninfo.FileVersion
    "Date created" = $itemproperties.CreationTime
    Size = "$($itemproperties.length/1kb) kb"
}