windowspowershelldllcommand-lineldd

Is there a Windows equivalent for the UNIX ldd command?


I have a list of DLLs and I would like to know the versions of all other DLLs, used by those files. In UNIX this is very simple:

ldd *.dll

But in Windows this does not work (I tried using my Ubuntu WSL).

Does anybody know a commandline command for this? (Powershell is good, too)


Solution

  • dumpbin.exe /imports will list the immediate static load dependencies, but not attempt to resolve them (which implies no version numbers nor transitive dependencies)

    depends.exe will resolve dependencies (including dynamic load ones if you run in "profiler" mode which supports a variety of different methods for hooking LoadLibrary(Ex) and GetProcAddress) but is not a command-line tool. For each dependency it lists the path and version number, along with a lot of other information such as link date and required OS version -- you should be able to save this list to a file for command-line processing.

    Neither of these is included in the OS distribution, you'll need a Windows SDK tools package.