Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i am on windows 10.
i ran my program as admin
i use [RegOpenKeyEx] to open regestry key.
then i use [RegSetValueEx] to set the values.

but some keys access is denighed i would like to set the key to full control
or writable in code.

any c++ meathode will do im not picky ill take any code method.
even a cmd command to do it. or change the keys by comand promp.
i can allready do it manualy by opening registry but that
gets tedeuse or time cunsuming.

iv been tweaking with [RegGetKeySecurity] and [RegSetKeySecurity] but no luck.

if a method is given please also supply needed #include

What I have tried:

iv been tweaking with [RegGetKeySecurity] and [RegSetKeySecurity] but no luck.

coman promp lines.
Posted
Updated 3-Apr-18 3:11am
Comments
Richard MacCutchan 3-Apr-18 8:58am    
Some keys are protected and can only be changed by the Windows OS. Microsoft's general advice is do not mess with the registry.

1 solution

Some keys are restricted by the system for really good reasons, but other may editable when running in adminstrator mode. The article Elevating during runtime demonstrates the needed technologies and functions.
 
Share this answer
 
Comments
[no name] 3-Apr-18 9:29am    
But is it not this like, that (even it is not a good idea) I have always the possibility to take ownership of the respective key and have then the rights to modify it?

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