I've got remote serial-port kernel debugging set up to watch for debug breaks on a laptop. The laptop repros a bug that causes it to break into the kernel debugger in the middle of the night when I'm gone.

Normally, I'd type "!analyze -v" into the debugger command window to find out what the cause of the break was and have it pull up the source code. The problem is, by the time I've arrived in the A.M., the laptop has powered itself down; its processor thermal manager doesn't like it spinning in a tiny loop waiting for the kernel debugger to do something. After the laptop has done this, the commands in the kernel debugger no longer work.

So I need to get WinDbg to automatically do an !analyze -v as soon as the laptop hits the debug break. Anyone have any ideas about how I could elegantly go about this?

Does not work:
- Typing the command ahead of time and just waiting for it to spill out of the keyboard buffer when the break is hit. Doesn't work because the keystrokes are ignored until after the break is hit.

Can do but inelegant:
- Write a complex VBscript or Perl program to wait for the WinDbg window to show the break, then Sendkeys.
- Wait all night.

Any other ideas?
_________________________
Tony Fabris