What NOT to do with Process Explorer (another lesson learned...the hard way)
For those of you who've never heard of them, there's a couple of guys by the name of Mark Russinovich and Bryce Cogswell who run a site called Sysinternals. Sysinternals provides some of the most useful utilities available for Windows (NT, 2000, XP, etc. - don't tell anyone, but they've also got some for Linux, too). Developers and admins alike should definitely keep this site in their favorites list.
But I'm not blogging just to suck up to Sysinternals. After all, their utilities are free (though they do have another site, Winternals, that provides more full-featured utilities that are commercial software), so sucking up really won't get me anything anyway. No, I'm blogging to share my experience with one of their cool tools, called Process Explorer. Process Explorer allows you to look at all of the processes running on your machine, and drill down into the resources being used by those processes, find out quickly which program is responsible for a given process or processes, and (among other things) kill or change the priority of a process.
It's that last bit that tripped me up earlier this evening. While continuing the prep work for my pre-conference session at PDC, I noticed that for some unknown reason, Powerpoint was sucking up all the CPU cycles on my laptop. Other programs kept working, so I just killed off PP using the Task Manager, in hopes that when I restarted it, it would behave itself. No such luck. Each time I restarted Powerpoint, it hung. So I decided to fire up Process Explorer and take a look at what was going on to see if there was an obvious cause. So far, so good.
Once I've got Process Explorer open, I use it to kill off Powerpoint again, to see if any other processes go with it (in case some child process was causing the problem), and then fire it up again, only to have it hang once again. Then (and here's the good part) without really thinking about it, I decided to try changing the priority of the Powerpoint process, to see if perhaps there's something it's working on that I can get to finish more quickly. In fact, I'm so not thinking about it that I change the process priority to the highest level, Realtime. D'OH!!!
To make a long story short...DON'T DO THAT! By taking a process that was hanging and assigning it Realtime priority, I instantly hung my entire system. Fortunately, I was able to recover by simply powering down the laptop and restarting, and also fortunately, I didn't lose any data because Powerpoint had auto-saved my most recent notes, but it could easily have been much worse.
Bottom line is that there are some very powerful tools available from the folks at Sysinternals...but like woodshop power tools (I do carpentry as a hobby), if used improperly you can run into big problems really fast. Even if you know what you're doing, it's sometimes easy to space out for a minute and do something...well, stupid (let's be honest here). If you're using a power tool in a woodshop, you can lose a finger. If you're using a tool like Process Explorer, you can lose data, time, and perhaps worse. Don't learn that lesson the hard way.