Reputation:
I develop a utility that has to write into Windows registry. I'm wondering if users who have not administrator rights, can write to registry. I tried the "HKEY_LOCAL_MACHINE" and it is locked. Is there any section in registry that these users can write into? If not - what rights are necessary for users to write into registry if they are not members in admin. group?
Thanks in advance!
Upvotes: 3
Views: 2011
Reputation: 106916
For user settings you have to use HKEY_CURRENT_USER
. Each user has a personal copy of this registry and one user cannot access the settings of another user. If the user has a roaming profile the registry will roam with the user on different computers.
If you really need a setting that is stored on the local computer and shared by all users on that computer you will have to use HKEY_LOCAL_MACHINE
. To enable non-admin users to write to this registry you will have to modify the ACL on the registry key you are using. To do that you need to have elevated privileges. This can be done using an install program. This is not a common approach.
You can read more about the Windows registry on MSDN.
Upvotes: 5