Answer the question
In order to leave comments, you need to log in
C#. How to give permission to add/remove registry keys?
In my application, I implement the ability to add / remove the context menu in the explorer. I'm trying to add/remove a key here:
HKEY_CLASSES_ROOT\jpegfile\shell
jpegfile - file type (I use several of them)
Answer the question
In order to leave comments, you need to log in
Depending on where to write. HKCR is a virtual hive consisting of HKCU\Software\Classes and HKLM\Software\Classes. If you write in HKCU, then all the rules, rights are not needed. But the association will only be for the current user.
Perhaps you can write a service that will start with administrator rights when the application is installed. Then the application through this service will change the registry values. It seems that this is done to automatically update some applications, so as not to constantly ask the user for permission to install.
How to allow the application access to these registry branches?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question