Process Explorer 是否支持 API 或从控制台命令调用?
假设我安装了一个软件的多个版本,其中一些DLL被注册为COM。 例如:
.../version1/Application.exe
normal.dll
comObject.dll -- register as COM to use
.../version2/Application.exe
normal.dll
comObject.dll -- register as COM to use
如何知道哪个comObject.dll被注册?(哪个路径?在文件夹“version1”或“version2”下?) 答案:一种方法是使用“Process Explorer”,转到“Find | Find Handle or DLL...”,输入“comObject.dll”并单击“搜索”按钮。 然后路径将显示在列表中。
现在我的问题:如果一个软件包很大,安装了数百个基于 COM 的 DLL,我不想手动打开“Peocess Explorer”并搜索每个 DLL/OCX/EXE,超过那,在搜索结果中,我不可能把列表内容复制出来!!
我想要的只是一个像下面的命令一样运行的工具,并且我可以在 bat 文件中运行。
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 可以如下所示:
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
在上面的示例中,comObject1.dll 和 comObject2.dll 来自 Version1 文件夹, 而 comObject3.dll 来自 Version2 文件夹。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
伟大的 Process Explorer 的命令行等效项是 ListDlls 和 句柄。这可能就是您所需要的。
The command-line equivalents of the great Process Explorer are ListDlls and Handle. That's probably what you need.