Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I am designing an utility in which I need to delete all the registry key values containing a specific word in HKEY_LOCAL_MACHINE\SOFTWARE\

But I am not having any idea, that, how to iterate through these registries..

Please help.

thanks in advance.
Posted
Updated 24-Feb-12 18:40pm

1 solution

 
Share this answer
 
Comments
djrocks0101 25-Feb-12 0:56am    
I have gone through it, but the problem is, how do I iterate through all subkeys in HKEY_LOCAL_MACHINE\SOFTWARE containing a specific word in its name or value.
Аslam Iqbal 25-Feb-12 1:10am    
Just add an enumerator ( foreach ). I didn't try this code. Please try yourself.
.............
RegistryKey rk= baseRegistryKey;
...
rk.OpenSubKey("your keyword");
foreach (var k in rk.GetSubKeyNames() )
{
//..............................
}
ProEnggSoft 25-Feb-12 1:51am    
Good link to article. Hence my 5!
djrocks0101 27-Feb-12 5:43am    
But how do I search all registry keys with specific string..because I am not having any idea, that how many times do I need to iterate..and here if I use the code above, the nesting of loop will increase and increase the time complexity as well..
please help..

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