Attempting to delete a subsection tree: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.hdr . .hdr subsection has one subsection, no values. Therefore, I use this code:
RegistryKey FileExts = Registry.CurrentUser.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts"); RegistryKey faulty = FileExts.OpenSubKey(".hdr"); Debug.Assert (faulty != null && faulty.SubKeyCount != 0); faulty.Close(); FileExts.DeleteSubKeyTree(".hdr");
And I get an ArgumentException message with the message "Cannot delete the subsection tree because the child section does not exist."
WTF? I checked and claimed that it exists?
Status Update
Searching with Process Monitor, subsection ".hdr" receives an ACCESS DENIED error when running the code. I checked the authorizations, but they look fine?
source share