
Load a User's Hive Programmatically
Jerald,
Load the user hive file into the local registry using the RegRestoreKey api.
Make your changes, then use RegSaveKey to write the hive to the hive file.
Unfortunately, I have no sample code using those api's, but if you like, I
can
prepare some for you. Let me know.
Bj?rn Holmgren
Framfag/Guide AB
Quote:
> I have a program that will list all the user's accounts on a NT
> system --could be a local NT system or a remote NT system. Based on the
user
> accounts the operator of the program can then pick a user from the list of
> accounts to make modifications to their registry. This means the program
> will need to dynamically load the accounts hive programmatically. What is
> the best way to do this? I looked at the APIs LogonUser and
> CreateProcessAsUser. I have noted that LogonUser will fail if the system
is
> a remote system.
> I did find the article within the MSDN entitled, "Load a User's Hive
> Programmatically" within the MSDN. Unfortunately the examples are all in C
> making it hard to read for this VB only programmer. Can anyone shed some
> light on the best path forward to accomplish the aforementioned goal or
have
> some code samples in VB for loading a User's hive programmatically?
> Thanks!
> JR