I was preparing some WinDbg
demos under Windows 7, when I bumped into an issue with ADPlus.vbs. I tried to generate dumps of IIS (W3WP.EXE) when it crashes.
It seems that ADPlus generates "package names" from the Process parameters (how the process was started, command line arguments). It uses then these package names for dump files, CDB configuration files and Exception configurations.
The problem was, that on my Windows 7 machine the W3WP.EXE parametes were a mile long (something over 160 characeters anyway). This meant that when running ADPlus.vbs it failed because of long filenames. It generated the dump directory name and some filenames that went over the 255 limit imposed on non-unicode applications.
First I tried generating dumps into a higher directory - not really ideal, but maybe it could work. Using only a \TEMP folder for the dump output path solved the file name too long problem. However, then came the problem that it was complaining about the Exception configuration. The error message was something like: The command size for the exception [AccessViolation] is  and exceds the allowed limit. You can reduce it's size by using an output directory with a shorter name
Google helped not this time
I ended up adding a quick tweak into ADPlus.vbs. I copied it into ADPlus_custom.vbs and added the following code after line 2550. In case you have a different version, this was in the Sub DumpSelectedProcesses()
, after strPackageName
was assigned and appended with the package name in the If
statement. Right before the variable was printed out with WScript.Echo
if len ( strPackageName ) > 40 then
strPackageName = left ( strPackageName, 40 )
I know it is a very dirty hack, but at least it works