Does Process Explorer support API or call from Console Command?

6.3k views Asked by At

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.

1

There are 1 answers

3
Eran On BEST ANSWER

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