Use a command file for Windbg which sets up your configs and then runs !analyze
. Set windbg to output to a file (as described here: windbg: Command output to text file)
Then you can enjoy trying to sort, categorize, etc. the output from that. !analyze
will do a decent job of analyzing most crashes. If it can't, I doubt you'd be doing a better job with your own code, unless you have a lot of experience in analyzing crash logs by program (I haven't ever tried, although I have a decent idea of what to look for, I wouldn't necessarily want to write code to actually do it - I have written code to write logs when the system has crashed, so I know what you usually need).