• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

C# How to find a registry entry with a changing name

idonotcare

New Coder
Hi, sorry if this is a dumb question, I'm making a program that deletes specific registry entries/keys. But the entries name is not the same always. How can I ensure that I find and delete the correct entry and not something critical?

Example. Entry is located at "Computer\HKEY_CURRENT_USER\Software\Microsoft", and its name is "thisentry" when I delete it
its name changes to "thatentry". I need to find it on demand but can't no longer find it by searching for "thisentry"
 

Narvuk

Active Coder
There is no definitive answer to this question since the name of a registry entry can change for any number of reasons. However, one possible way to find a registry entry with a changing name is to use a registry editor tool to search for all entries that have been modified within a certain time frame. This will allow you to see all entries that have been created or modified recently, which may include the entry you are looking for.
 

cbreemer

King Coder
It's not a dumb question, it just seems a dangerous thing to do. Why does the name of the registry entry change, specifically when you delete it ? Is this indeed a Microsoft key ? Those you typically want to stay clear of. Or is it your "own" key ? In which case perhaps you might be better off working in some less sensitive registry branch ? How and why exactly does the name change ? Is there a pattern to it that you can implement ?
More questions than answers I'm afraid...
 

Antero360

King Coder
Staff Team
Security Analyst
Hi, sorry if this is a dumb question, I'm making a program that deletes specific registry entries/keys. But the entries name is not the same always. How can I ensure that I find and delete the correct entry and not something critical?

Example. Entry is located at "Computer\HKEY_CURRENT_USER\Software\Microsoft", and its name is "thisentry" when I delete it
its name changes to "thatentry". I need to find it on demand but can't no longer find it by searching for "thisentry"
Just seen this... sorry for the extremely long time lol... but is there a particular reason why you would want to delete registry keys?
 
Top