views:

239

answers:

3

I'd like to read/write some registry information from my non-admin Windows Service, and have it applied regardless of the user logged in. Would using a subkey of HKEY_USERS/.DEFAULT do the trick?

Essentially, something like CSIDL_COMMON_APPDATA but in the registry.

Thanks!

A: 

What's wrong with HKEY_LOCAL_MACHINE?

Stu
Non-admins can't write to HKLM in XP, Vista, or Win7.
Ken White
Also, your post isn't an answer; it's a comment asking for more information. You should know better by the time you reach 3K in reputation. :-)
Ken White
reputation means nothing here :(
Samuel_xL
A: 

What do you mean by "have it applied"? I assume you mean write it to one place and all other users can read it; in that case, HLKM is the only answer. Why not change your service to run under one of the service accounts?

Luke
A: 

You could create a key under HKLM and set the ACL to allow all users read/write access. Obviously you would need to do it from an account with sufficient privileges to begin with.

tyranid