I am writing a small program using C# that needs to set set the power settings for all users. This means I will need to change the Hkey Current User, and all the profiles under the Hkey Users hive. I know how to change the power settings registry keys, but I do not know how to “cycle” through all the users “profiles” (for lack of a better word) and make this change under their settings. How do I do this, or is there a better way to do this. I apologize if the scenario is not clear.
Thanks
msindle
There is no general way to edit other users’ Registry settings directly. Other users’ Registry settings might not even be stored on your computer. For a taste of some of the problems, read Raymond Chen’s blog post, “Beware of roaming user profiles“. (Make sure you understand what he has to say — some of it applies even if you’re writing an internal tool on a network that doesn’t have roaming profiles enabled.)
The best solution would probably be to make a small app that makes this change for the current user, and add it to everyone’s login script. That would mean your utility would change the setting every time they log in, rather than making a one-time change (so they wouldn’t be able to change it back permanently), but you would be sure it happened for every user.