Skip to content
⌘ NSIS Forum Archive

How To Export a Whole Registry Branch?

7 posts

n0On3#

How To Export a Whole Registry Branch?

I am willing to export a registry branch to a .reg file. But I don't know how to do it.

I feel that the most primitive way would be to make a loop with EnumRegKey and EnumRegValue and then FileWrite that info to the regfile. But, is there a better way to do that? (speed is a factor in this situation)
rsegal#
EnumRegKey is probably a good way. You could also read all the registry keys either iteratively or recursively. Not sure if that would be faster or not.
Joost Verburg#
Access to regedit is sometimes not available for restricted users. If that is a problem, you should find another way.
n0On3#
Great kichik!
I think that will make my job very easy 🙂

I knew that "/s" was to insert silently but didn't know that one 😱

Few more tricks with the registry:

if want to delete a branch write a dash between the H and K, like this:

[H-KEY_CURRENT_USER\Software\blabla]

and if want to delete a value write a dash after the equal, like this:

value=-


if anyone knows more tricks please leave them here🙂
kichik#
You can always process the .reg file yourself for that, but I can't see how that would be useful if you have NSIS's DelRegValue and DelRegKey.