Get the file version of a dll or exe [duplicate]
Poss开发者_JS百科ible 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?
Is it possible to get the file version of a dll or exe file using batch commands and store it in a variable?
Here's an example using 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
Have a look at the Sysinternals utility SigCheck. Try this in your batch script:
sigcheck.exe -n YourFile.exe
精彩评论