5
votes

How do I ask for an elevation for Registry access to HKLM? I'd like to add EnableLinkedConnections to "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\". I also don't want to use a manifest file. Ive tried the below code but it doesn't seem to help.

RegistryPermission f = new RegistryPermission(
   RegistryPermissionAccess.Create,
   @"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
   Policies\System\EnableLinkedConnections\1");
f.Demand();

Can anyone tell me what I'm doing wrong please? Thanks

1
does the user account have the rights to modify the registry?Ryan Alford

1 Answers

4
votes