How can I import .reg files into a custom location?

1

I have a .reg file which I wish to explore using the Registry Editor as part of a registry hive. For this, I have to import it. However, neither the Registry Editor nor reg.exe offer a way to specify an import location.

For example, I'd like to import my .reg file into HKLM\TempHive, so if it contains HKLM\System\Foobar, the new key would be under HKLM\TempHive\HKLM\System\Foobar.

Ilya

Posted 2014-02-23T16:03:41.607

Reputation: 1 584

Answers

1

You can either import a registry file directly or load a registry hive, but not vice-versa. While registry files are human-readable text files, registry hives are binary files, and are handled differently.

If you want to convert a .reg file to a registry hive, you have to import it first, and then export it as hive using either regedit or reg /save.

As a workaround, you could change the base path inside the registry file to e.g. HKEY_LOCAL_MACHINE\Temp, and then remember to delete the key when you're done.

Further reading

and31415

Posted 2014-02-23T16:03:41.607

Reputation: 13 382