From Magical Jelly Bean Software:
Magical Jelly Bean Keyfinder is a freeware utility that retrieves your Product Key (CD key) used to install windows from your registry. It also has a community-updated configuration file that retrieves product keys for applications. Another feature is the ability to retrieve product keys from unbootable Windows installations. Features include optional config file lets you pull a key stored in the registry for any software, command line options /save /savecsv /close /hive /file , load hive option allows you to load the registry hive of another Windows installation, and save options is available in text or CSV. To load hive option put the hard drive in a working machine (must also be Windows 2000, XP, Vista or Windows 7) or use Windows PE (not tested, should work) and click Load Hive. Then point it to the dead Windows install. If you're using Windows Vista, Administrator rights are required for this feature. You may have to right click on the Keyfinder and run as Administrator.