powershell - 在 Windows Server 2016 中使用命令行获取 exe 的 'Copyright' 信息字段

标签 powershell cmd file-properties

我有兴趣使用 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/

相关文章:

asp.net - 用于应用 Entity Framework 迁移的 PowerShell?

powershell - 在powershell中重命名文件

windows - PowerShell:还显示用户名和进程名称的 Get-NetTCPConnection 脚本

windows - 使用 DISKPART 删除驱动器号的 BAT/CMD 文件

windows - 如何使用 VB6 或 BAT/CMD 列出连接到我的 WiFi 网络的设备?

node.js - Node JS - 读取文件属性

crash - Libreoffice Writer在编辑文件属性时使计算机崩溃

powershell - 对为什么 PowerShell 对待函数不同于子项感到困惑,即使类型相同

php - 使用cmd保存带有DATE的mySQL文件

python - 创建类似 MS Office 文档的文件格式以公开文档属性