@echo off echo version: wmic datafile where Name="C:\\Product\\File\\Release\\1.1.1\\File.exe" get Manufacturer,Name,Version pause
運行結果:
上面的例子是通過 WMIC 獲取文件版本號
通過 WMIC.exe 獲取文件信息
https://docs.microsoft.com/zh-cn/windows/desktop/WmiSdk/wmic
通過 WMIC 可以獲取的所有文件信息如下:
Access Rights
Caption
Class Name
Compressed
Compression Method
Computer System Class Name
Computer System Name
Creation Date
Current File Open Count
Description
Drive
Eight Dot Three File Name
Encrypted
Encryption Method
File Extension
File Name
File System Class Name
File System Name
File Type
Hidden
Install Date
Last Accessed
Last Modified
Manufacturer
Name
Path
Readable
Should Be Archived
Size
Status
System File
Version
Writeable
wmic datafile where name='c:\\windows\\system32\\notepad.exe' > out.txt
http://winplat.net/2009/09/24/how-to-check-file-properties-through-wmi-command-line/