URGENT! How do I import .reg to the registry on another XP hard drive

HONG KONGer

Limp Gawd
Joined
Apr 26, 2003
Messages
129
My friend's hd is not bootable now and I need to import a .reg to his registry to solve the problem. But since the drive is not bootable in his/my computer, so I can't do it in the regedit in XP.

I also tried to attached his drive to my PC as drive D but the regedit can't open the drive's registry.

So how do I import the .reg file to my fd hard drive???
 
You'll need to know a little bit about the registry to do this... I'll try to help.

The registry is stored in two places.

The user settings are stored in the users profile in a file called ntuser.dat (or .man if the profile is mandatory, but it probably isn't in your case). You can find this file in the C:\Documents and Settings\%username% directory.

The system settings are stored in various files under %winroot%\system32\config. The files are as follows:

SYSTEM
SOFTWARE
DEFAULT

When you run registry editor, you need to tell it to load these hives. You can then make changes to the hive and save it back out. To do this, you'll need to either boot to an alternate operating system (like Windows PE) or move the files/hard drive into another machine.


It sounds like you are moving the hard drive to another machine, so that makes things easy. For reference, I'm going to call this hard drive D:.

The first thing you would do is make sure the drive is working and you are in windows. Start regedit (start > run > regedit >ok).

Once the Registry Editor has opened, click on the HKEY_LOCAL_MACHINE hive. Yes, this will be the HIVE for your machine, but don't worry. Just highlite it, don't open it or anything.

From the file menu, choose Load Hive. You are going to be prompted with a file open dialog box. This is probably the trickiest part here, as you need to find the right file. If you need to make a change to something in HKCU, then you would load D:\Documents and Settings\(username)\ntuser.dat. Otherwise, you'll need to find the proper hive in D:\Windows\System32\Config. You're probably looking for something under software or system. You might have to do a little hunting to determine which file, but as long as you don't make any changes, it won't save anything so feel free to experiment with caution.

After you load the file, you'll be prompted for a Key Name. This is where it will "mount" the key to under HKLM. I suggest doing something like _<filename>. So, for software, use _Software. But really, you could name it whatever you wanted, you just have to remember what you called it. Once you name it, click the OK button and you will see it pop up under HKLM.

Expand the branch that you just created and it will show you the contents of the registry file. So, if you loaded the software hive, and you called it _Software, then on your machine, HKLM\_Software will point to the file you just loaded. Any changes you make will be saved in that registry, not yours.

Look at your registry file -- you can either modify the registry file to point to the new key you created, or make the changes manually. That really depends on your comfort level. I'm assuming you know how to do this part, if not -- holler back.

Once you have made the change that you needed, highlight the key you created and open the file menu. Click the unload hive option, and you will be prompted. Answer yes to unload the hive and all of it's subkeys. <note, if the unload hive option isn't available, it means you don't have the key you created highlited>

That should be it. Just be careful because editing the registry is easy, and can be very dangerous. Especially so with the keys you are probably editing. Make sure you are editing them on the other hard drive, and you don't accidentally import them into your machine -- that could be very bad!

Good luck!
 
Back
Top