我有兴趣使用 cmd 或 PowerShell 获取“版权”信息字段。手动访问,可以通过
右击可执行文件 -> 属性 -> 详细信息 -> 版权
我知道 wmic datafile
命令,
wmic datafile where Name="C:\Windows\System32\cmd.exe" get Manufacturer,Name,Version
但它不提供文件属性中详细信息
选项卡中的大部分详细信息。
如何使用 cmd 或 PowerShell 获取此信息?我相信 Python 应该能够轻松解决它,但有时无法在生产服务器上安装 python。
最佳答案
Powershell 实际上在 VersionInfo 属性中为您提供了大量信息。
(Get-Item "C:\Windows\System32\cmd.exe").VersionInfo.LegalCopyright
如果您需要,这里有一篇 technet 文章,其中包含更多信息。
https://blogs.technet.microsoft.com/askpfeplat/2014/12/07/how-to-correctly-check-file-versions-with-powershell/
关于powershell - 在 Windows Server 2016 中使用命令行获取 exe 的 'Copyright' 信息字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49262251/