Changing registry without admin rights
I thought I needed admin rights for changing registry (I get e开发者_开发技巧rrors if my app doesn't have such). Maybe only some part of the registry require admin rights.
Could you give some information? I need to store my app data somewhere without admin rights.
You need administrative privileges to write to locations that are shared by multiple users.
In the filesystem, this means folders like \WINDOWS
or \Program Files
.
In the registry, this means all of the hives which aren't per-user.
Therefore, you can only write to HKEY_CURRENT_USER
.
Specifically, you should write to HKCU\Software\Your Company
.
Log in as a normal non-admin user. Open up regedit, right-click on the top level keys and examine the permissions for each, you'll see which ones you can write to as a user. Basically, it's just HKEY_CURRENT_USER as SLaks says.
HKEY_LOCAL_MACHINE is off limits, for instance. You can write to HKEY_USERS/your users SID, because HKCU is basically an image of that.
精彩评论