Associate windbg with .dmp files

If you get tired of starting the debugger, loading your dump, setting up your sympath, loading your extensions, etc. etc. here is a nifty way of getting "Debug this dump" on the context menu for .dmp files and get all your favourite commands automatically loaded.

First create a .reg file with the following contents (as always be very careful when modifying the registry)

Windows Registry Editor Version 5.00





@="Debug This Dump"

@="\"C:\\debuggers\\windbg\" -z \"%1\" -c \"$<c:\\debuggers\\commands.txt\""

@="Debug this Dump With Remote:70"

@="\"C:\\debuggers\\windbg\" -server tcp:port=70 -z \"%1\" -c \"$<c:\\debuggers\\commands.txt\""

This will give you two additional options on the context menu when rightclicking on .dmp files. First "Debug this dump" which will open windbg with your dump and then run the commands in commands.txt. The second option "Debug this Dump With Remote:70" will do the same thing but also set up a remote so that your coworkers can remote in to your debugging session though port 70. (Remember to change the paths so they point to the directories where you have windbg.exe and commands.txt)

Secondly, create a file called commands.txt that contains any commands you want to run when the debugger starts. The one below sets the symbol path to the public symbols and loads sos.dll.

.sympath srv*c:\websymbols*
.load clr10\sos

I stole this reg file from a colleague of mine, but can't remember who, so unfortunately i can't give the proper person the credits, but whoever it was, thank you:)  


Comments (17)
  1. Hasani says:

    Incredibly useful!

    I have windbg installed in my ‘progam files’ so the above regedit script didn’t work. Regardless though, this is an excellent timesaver for when using windbg.

    Windows Registry Editor Version 5.00








    @="Debug This Dump"


    @="C:\Program Files\Debugging Tools for Windows\windbg" -z "%1" -c "$<C:\Program Files\Debugging Tools for Windows\commands.txt"

  2. John Lan says:

    great, cbd.exe should be corrected as cdb.exe else the icon will be missing…

  3. Tess says:

    Sorry about the typo:) it’s corrected now…

  4. Tal Rosen says:

    Didn’t work on my machine 🙁

    However this modification did do the trick


    @=""D:\Program Files\Debugging Tools for Windows\windbg.exe" -z "%1""

    I just had to add "-z"


  5. Howard says:

    If you just want to associate dump files with windbg but don’t want to load any extensions automatically, or prefer to do that separately, you can run "windbg -IA" from the command line (if anyones interested).

  6. If you’re like me and most of my colleagues in Customer Service and Support, you’ll probably spend a

  7. During a discussion here about debugging in Windows we got onto the topic of extensions and tricks to

  8. Thomas says:

    Whenever I open a crash dump, I get a syntax error. When I execute the .cmdtree manually it works. Any ideas?

    Processing initial command ‘$<c:dumpcommands.txt’

    0:000> $<c:dumpcommands.txt

    0:000> .cmdtree c:dumptree.txt

        ^ Syntax error in ‘.cmdtree c:dumptree.txt’

  9. Tess says:

    thomas, only thing i can think of is some weird character either in between .cmdtree and the path, or in the tree.txt file itself…

    I dont see why that command shouldnt work in a commands script

  10. PJ says:

    Did this issue ever get sorted out?  I am struggling with it now.   I can’t seem to get a commands file to process the .cmdtree command at all.   If I type the same line in windbg, it works fine.  

  11. Tess says:

    PJ, i never had that issue, so unfortunately i dont know what the issue could be… still works for me in all versions of the debuggers that i’ve tried…    

    I know that that wont help you much though 🙁

  12. PJ says:

    hmmmmmmmm………annoying…. oh well.

  13. PJ says:

    I started doing this:

    -c ".cmdtree c:mycmdtree.txt"

    Rather than a commands file.  That at least opens my cmdtree automatically.

    But any idea how to get it to dock?   I read your post on themes for WinDbg, but I can’t figure out how to get a commands window to dock in the BASE theme.   (cause you need to open a DMP file before you do a command, but then you ‘exit’ the base theme)

  14. Tess says:

    PJ, Thanks for this…

    I have been looking for a way to get it to dock automatically too but havent been able to so far

  15. PJ says:

    yeah…I even tried to hack it by creating a workspace setup the way I want, then exporting the registry keys.  I was hoping to diff it with my ‘base’ workspace and just make the changes by hand, but it looks like everything is stored as hex….oh well.

  16. vilig says:

    I associated dmp file to windbg from the open with list before reading this, how to get it back to original blank file with no autofile for win7?

Comments are closed.

Skip to main content