通过命令行获取Infotip

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

我指的是在Windows资源pipe理器中hover在文件名上时看到的popup框。

下面是一个示例脚本,它从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" }