简体   繁体   中英

c++ registry read/write from a non-admin Windows Service

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!

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM