Click here to Skip to main content
15,898,538 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
The below line gives an error:-
RegistryKey soft = root.OpenSubKey("SOFTWARE", true);


Requested registry access is not allowed.

How to cope with this problem?
Posted

1 solution

There are two ways:
1) Elevate your application so that it has the required permissions
2) Stop using the Registry.

Access to the Registry is becoming more and more restricted and is likely to be become even further restricted rather than less - mostly because it was badly overused in the past. Unless you absolutely need to examine existing values, then I would strongly recommend that you do not use the registry for anything. There are better places and ways to store your data which will be available in future OSes.

However, if you have to do it, you can elevate your app : http://support.microsoft.com/kb/981778[^] - however this will engage the UAC and require explicit confirmation from the user.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900