Does exporting a registry key in hive binary format preserve permissions and how can I import them to another machine?

4

2

When I export a key in the registry on my Windows 7 machine, I get the option of .reg or a hive file in binary.

What's the difference?

Does the binary hive file preserve the permissions? Example, I have a key, bfe, and it has various permissions for "nt service\bfe." Will the binary save save that?

How can I import that back in on another computer that has that key but broken?

Thanks.

johnny

Posted 2012-06-01T17:39:47.760

Reputation: 1 783

Answers

7

The textual .reg format does not support WinNT security features; it only preserves the data exported, as you can see by opening the .reg file with a text editor.

The "hive" format is identical to the one used by Windows to store the registry itself. This means that it supports all features used by registry, including security permissions and ownership. You can examine exported "hive" files by using "Load hive" in regedit or reg load in command line, and import into the main registry with reg restore.

However, remember that users on Windows are identified by their SIDs; local accounts will have different SIDs on different machines, so you may still have to adjust the imported permissions manually. (Builtin accounts such as "NT AUTHORITY\SYSTEM" have the same SID everywhere. Domain accounts always have the same SID on every domain member.)

user1686

Posted 2012-06-01T17:39:47.760

Reputation: 283 655

How can I identify the SID on something such as nt service\bfe? – johnny – 2012-06-01T19:22:59.800

-1

From Wiki.

Hives

The Registry comprises a number of logical sections, or "hives". Hives are generally named by their Windows API definitions, which all begin "HKEY". They are frequently abbreviated to a three- or four-letter short name starting with "HK" (e.g. HKCU and HKLM). Technically, they are predefined handles (with known constant values) to specific keys that are either maintained in memory, or stored in hive files stored in the local filesystem and loaded by the system kernel at boot time and then shared (with various access rights) between all processes running on the local system, or loaded and mapped in all processes started in a user session when the user logs on the system.

How to add a reg key

Just double click on it and it will ask you to confirm the operation and click Ok it will be added in the registry file on OS. Or open the registry editor through run command and click on File> Import and then you can add the .reg or hive file.

enter image description here

enter image description here

Hive files are not accessible directly while you can run the registry file. Hive can be added through only the import option.

enter image description here

When you will try to import a hive it will completely restore the keys under it which you have backed up. While only a single .reg key will affect the only under the hive to that particular place(key) which it belongs.

avirk

Posted 2012-06-01T17:39:47.760

Reputation: 15 151

1Thanks. What about the security permissions part of things? – johnny – 2012-06-01T18:30:20.537