Hi,
I have 2 questions about Load_UnloadHive:
1. Per the WinBatch Article ID: W15140, we get Access Denied when you do the UnloadHive when you did not close all the subkey handles that you have open after doing the LoadHive to modify the registry of that Hive. I make sure that I have closed all the handles:
RegLoadHive(@REGUSERS,UserKey,ProfDir:UserKey:"\NTUSER.DAT")
user_class = regopenkey(@REGUSERS,UserKey)
Regkey = RegCreateKey...
........ do some RegSetDword
RegCloseKey(Regkey)
Regkey = RegCreateKey...
........ do some RegSetDword
RegCloseKey(Regkey)
Regkey = RegCreateKey...
........ do some RegSetDword
RegCloseKey(Regkey)
;(I have 3 such blocs between LoadHive and Unloahive)
regclosekey(user_class)
RegUnloadHive(@REGUSERS,UserKey) ; error = 5 Access Denied
I got Access Denied (error = 5) when performing the RegUnloadHive.
My question is can we have more than 1 Regcreatekey commands between the Load/UnloadHive
2. My next question is that there is somehow a way to get the list of all SubKey Handles that are still open.
3. My last question is, what will happen if we were not able to do RegUnloadHive and leave those regkeys in the HKEY_USERS? In that case did the corresponding non-open profiles get their registry (that we just modify) get update?
Thanks so much for your help.