Archive: How To Export a Whole Registry Branch?


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)


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.


This page should help:
http://www.jsiinc.com/subc/tip1000/rh1087.htm


Access to regedit is sometimes not available for restricted users. If that is a problem, you should find another way.


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 :eek:

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:)


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.


it was just general information