If dlllist.txt is supposed to list specific DLLs that an application depends on, ensure the list includes all necessary DLLs, for example:
# List of DLLs required by MyApp
myapp.dll
support.dll
utility.dll
If you do need to pass multiple arguments via a file, create dlllist.txt with one argument per line.
Example dlllist.txt:
-accepteula
explorer
Then run:
dlllist.exe @dlllist.txt
On 64-bit Windows, running 32-bit tools from SysWOW64 may cause file system redirector issues. Use: failed to open dlllist.txt for reading error code 2
%windir%\Sysnative\cmd.exe
Then run your dlllist command from there.
Dependency Walker has a built-in scripting feature. Advanced users can create scripts to automate profiling of executables. When you run a certain type of profile (especially a "profiled" or "profile with log file" session) using a script, the tool looks for a file called dlllist.txt. If dlllist
The script likely contains a line that says:
OpenFile("dlllist.txt", READ)
Since the script expects this file to be present in the current working directory (usually the same folder as depends.exe or your target EXE), and it is not there, Windows returns Error Code 2. If you do need to pass multiple arguments
In short: The error is a feature, not a bug. The script is trying to do its job, but the input file is missing.
try
& ".\dlllist.exe" "@dlllist.txt" -ErrorAction Stop
catch
if ($_.Exception.Message -match "error code 2")
Write-Host "Missing dlllist.txt – creating now"
New-Item -Path "dlllist.txt" -ItemType File
& ".\dlllist.exe" "@dlllist.txt"