C# - I want to add "Everyone" user with full permission to a registry hive. Is there a way for this?

jazzIIIlove
jazzIIIlove used Ask the Experts™
on
Hi there;

I want to add "Everyone" user with full permission to a registry hive in C#. Is there a way for this?

I think I can create key and subkeys but I don't know how to add "Everyone" user in Windows and giving full permission that user. How can this be done?

Best regards.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
but where is the "Everyone" in those code? or which code?
Any other recommendations?

Best regards
Senior Software Developer
Top Expert 2009
Commented:
Try the following
using System.Security.Permissions;

RegistryPermission permission = new RegistryPermission(RegistryPermissionAccess.AllAccess,@"HKEY_LOCAL_
MACHINE\Software\MySoftware\MyKey");

permission.Demand();

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial