Hey there!
I am trying to do 2 things, hopefully there is a solution.
Summary
My application requires a set of registry keys. I need to add these keys so that they are available for all users existing & future. I know that i need to refer to HKU instead of HKCU.
- Existing users
Here i am trying to loop through the existing users while ignoring the built-in accounts. I can loop add the required registry keys. This means that when an existing user logs on to machine, the registry keys can be read using HKCU.
- New Users
The method about only works for existing users so i need to allow for future users. To do this, i need to load the Default hive, add the registry keys to the Default hive then unload the hive.
Issues
Issue#1 - When i loop through the SIDs, i can successfully identify each one but when i add the registry keys & values, it only occurs on the current user and skips the others.
Issue#2 - If the user is not admin, the registry SIDs cannot be accessed.
Issue#3 - If the user is not admin, the HKU\Default hive cannot be loaded.
I feel that there must be a way around because other applications that are installed in a user environment (not admin) can access the Default hive and other user hives. My streamdeck for example was installed at user level but when i create a new test user, pops up ready for a new user setup and there registry keys and values are in HKU\Default
Questions
- Am i able to override the permissions at user level? If so, how?
- Is there an alternative method to what i am doing?
My installer application allows me to run a cmd or vbs file so im using one of these 2 methods. I can also move this to my application RunFirstTime class in vb.net if it makes a better solution.
Note:
I am not trying to add the registry keys to .Default as that is not the NTUSER default template, the hine HKU\Default needs to be loaded from C:/Users/Default/NTUSER.DAT and then registry keys added to that.
Thanks