Failed To Open Dlllist.txt For Reading Error Code 2 Site

In some automated malware analysis setups, a script might run:

dlllist.exe --pid %pid% > dlllist.txt

Later, another script tries to read dlllist.txt but runs it incorrectly:

dlllist.exe @dlllist.txt   # WRONG – treats file as command source

The correct approach is to use redirection for input, not @: failed to open dlllist.txt for reading error code 2

dlllist.exe /accepteula < dlllist.txt   # Still not standard for dlllist

But dlllist.exe does not support stdin redirection. So the proper fix is: don’t use @dlllist.txt unless you explicitly need a response file.

If your analysis pipeline expects dlllist.txt as a list of PIDs, use for /f in batch: In some automated malware analysis setups, a script

for /f "delims=" %%i in (dlllist.txt) do (
    dlllist.exe %%i
)

While dlllist.exe from Sysinternals is the most common source, the error can also appear in:

Batch script example:

if not exist dlllist.txt (
    echo Creating empty dlllist.txt...
    type nul > dlllist.txt
)
dlllist.exe @dlllist.txt

PowerShell example:

if (-not (Test-Path "dlllist.txt")) 
    New-Item -Path "dlllist.txt" -ItemType File
& "dlllist.exe" "@dlllist.txt"
 
Â