Windows下通过命令行 获取文件详细信息


@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/

 

posted @ 2019-07-01 23:14  Ryan_zheng  阅读(7237)  评论(0编辑  收藏  举报