I am trying to delete one folder from registry. Let's say I want to delete the folder
Software\TeamViewer
I have written code but it is gives an exception "you can't write". I guess its some kind of problem with the Permission & access rights.
string keyapath = @"Software\TeamViewer";
RegistryKey regKeyAppRoot = Registry.CurrentUser.OpenSubKey(keyapath);
regKeyAppRoot.DeleteSubKeyTree(keyapath);
How do I give permission to my software to delete folders from registry?
EDIT: I have admin rights of my system. Do I still need to exclusively assign rights to the application through my code?