首页 > 解决方案 > 输出 exe 使用的所有 DLL 的脚本

问题描述

在 cmd 行

tasklist /m /fi "imagename eq xxxxx.exe" > output.txt

将所有进程使用的 DLL 输出到一个文件。

如何将输出分隔为多个 txt 文件,每个文件都包含 DLL 使用的进程的名称?

标签: pythonpowershelldllcmdexe

解决方案


这应该可以得到你想要的:

Get-Process |
    ForEach-Object {
        $procName = $_.Name
        Get-Process -InputObject $_ -Module -ErrorAction SilentlyContinue |
            Export-Csv ".\$procName.csv" -NoTypeInformation
    }

推荐阅读