在Windows Server 2016中使用命令行获取exe的“版权”信息字段

时间:2018-03-13 17:23:24

标签: powershell cmd file-properties

我有兴趣使用cmd或PowerShell获取“版权”信息字段。手动,可以通过

访问

RighClick the executable -> Properties -> Details -> Copyright

我知道wmic datafile命令,

  

wmic数据文件,其中Name =“C:\ Windows \ System32 \ cmd.exe”获取   制造商,名称,版本

但它从文件属性中的Details标签中提供大部分详细信息。

如何使用cmd或PowerShell获取此信息?我相信Python应该能够轻松解决它,但有时候不能在生产服务器上安装python。

1 个答案:

答案 0 :(得分:4)

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/