windows 获取 dll 或 exe 的文件版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6697878/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Get the file version of a dll or exe
提问by Calumet
Possible Duplicates:
Command line tool to dump Windows DLL version?
How do I retrieve the version of a file from a batch file on Windows Vista?
可能的重复项:
用于转储 Windows DLL 版本的命令行工具?
如何从 Windows Vista 上的批处理文件中检索文件的版本?
Is it possible to get the file version of a dll or exe file using batch commands and store it in a variable?
是否可以使用批处理命令获取 dll 或 exe 文件的文件版本并将其存储在变量中?
回答by Dave
Here's an example using sigcheck:
下面是一个使用 sigcheck 的例子:
@ECHO OFF
FOR /F "tokens=1-3" %%i IN ('p:\supporttools\sigcheck.exe p:\supporttools\procmon.exe') DO ( IF "%%i %%j"=="File version:" SET filever=%%k )
ECHO The version of the file is %filever%
PAUSE