Command line tool to dump Windows DLL version?

I need a command line tool to dump standard Windows DLL version info so I can process it by means of a bash script (Cygwin).

As a Java developer I am not very used to Microsoft development tools (though I have a little bit of experience with Microsoft Visual Embedded C++ 4.0 and Microsoft Visual Basic 6.0).

The appropriate tool seems to be mt.exe, as stated on SO. However the only chance I have found to get this little application is to download a 1.29 GB ISO of the Windows SDK for Windows Server 2008 and .NET Framework. I can not believe this is the only way to do it.

I have also found a little application on the Internet called PEView, but it displays too much (and useless in my case) information and it is not a command line application.

Standard objdump bundled inside Cygwin can also dump some information about the DLL files, but I can not see the option to dump DLL version. Note that MajorImageVersion, MinorImageVersion and other fields dumped by this tool (with -p option) are not related to own DLL version.

Any alternatives about what to do? Maybe I missed some important objdump option? Is mt.exe my only choice? If this is the case, is it possible to get it separately from Windows SDK?


Solution 1:

You can use PowerShell to get the information you want.

(Get-Item C:\Path\To\MyFile.dll).VersionInfo

By default this will display ProductVersion and FileVersion But the full VERSIONINFO is available. I.e. to return Comments

(Get-Item C:\Path\To\MyFile.dll).VersionInfo.Comments

Solution 2:

Use Microsoft Sysinternals Sigcheck. This sample outputs just the version:

sigcheck -q -n foo.dll

Unpacked sigcheck.exe is only 228 KB.