8

Suppose I've installed multiple version of a software, some of the DLLs are register as COM. For example:

.../version1/Application.exe
             normal.dll
             comObject.dll -- register as COM to use
.../version2/Application.exe
             normal.dll
             comObject.dll -- register as COM to use

How can know which comObject.dll is registered?(which path? under folder "version1" or "version2"?) Answer: One way of doing this is to use "Process Explorer", go to "Find | Find Handle or DLL...", input "comObject.dll" and click "Search" button. Then the path is shown in the list.

NOW COMES TO MY QUESTION: If a software package is huge with hundreds of COM based DLLs installed, I don't want to manually open "Peocess Explorer" and search each DLL/OCX/EXE, more than that, in the search result, it is impossible for me to copy the list contents out!!

All I want is a tool to run like following command and I can run in a bat file.

ProcessExplorer.exe -Find "comObject1.dll" -append "C:\temp\output.txt"
ProcessExplorer.exe -Find "comObject2.dll" -append "C:\temp\output.txt"
ProcessExplorer.exe -Find "comObject3.dll" -append "C:\temp\output.txt"

output.txt can be looks like this:


Process          PID   Type  Handle or DLL
comObject1.dll    1    DLL   C:\ApplicationExample\Version1\comObject1.dll
comObject2.dll    1    DLL   C:\ApplicationExample\Version1\comObject2.dll
comObject3.dll    1    DLL   C:\ApplicationExample\Version2\comObject3.dll

In the example above, comObject1.dll and comObject2.dll are from Version1 folder, while comObject3.dll is from Version2 folder.

milesma
  • 1,561
  • 1
  • 15
  • 37

1 Answers1

10

The command-line equivalents of the great Process Explorer are ListDlls and Handle. That's probably what you need.

Eran
  • 21,632
  • 6
  • 56
  • 89
  • This is exactly what I want. Thanks eran! – milesma Oct 13 '11 at 06:20
  • @eran is there any such tool to get information about command-line of process, I want the command line tool to extract command the process is running. – user3462473 May 12 '16 at 15:10
  • The only downside I'm finding is that handle.exe isn't listing svchost handles, whereas Process Explorer does. I'm aware this answer is 9 years old. – ColinM Feb 21 '20 at 11:34