Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 745
Fernando Miguélez Avatar asked Mar 02 '09 15:03

Fernando Miguélez


People also ask

How do I tell what version of DLL is installed?

If you reference the dll in Visual Studio right click it (in ProjectName/References folder) and select "Properties" you have "Version" and "Runtime Version" there. In File Explorer when you right click the dll file and select properties there is a "File Version" and "Product Version" there.

How do I find DLL details?

With most Windows executables (DLL, EXE...), version and other details can be viewed using "Details" tab in "Properties" ( Alt + Enter ).

How can I see DLL in cmd?

Type "sfc /scannow" at the command prompt, then press the "Enter" key. The System File Checker will run. It will check for all missing and corrupted DLL files and replace them.

What is a DLL command?

A DLL is a library that contains code and data that can be used by more than one program at the same time. For example, in Windows operating systems, the Comdlg32 DLL performs common dialog box related functions. Each program can use the functionality that is contained in this DLL to implement an Open dialog box.


2 Answers

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 
like image 126
Graham Ambrose Avatar answered Sep 28 '22 17:09

Graham Ambrose


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

sigcheck -q -n foo.dll 

Unpacked sigcheck.exe is only 228 KB.

like image 45
Alessandro Jacopson Avatar answered Sep 28 '22 18:09

Alessandro Jacopson