# Batch find & delete registry keys keywords



## c_robertson (Aug 22, 2009)

My level of knowledge in programming is beginner.
I am knowledgeable in computers and repairing compuers is my profession.
OS XP, Vista, Windows 7

Ocassionally I find a keyword or program name in the registry that I need to remove.

Does anyone have an example of how to search for a keyword and remove that key from the registry? I have found some examples to delete keys when you know where they are.
I am well aware of the damage if I remove/delete necessary keys. I would like to approve each before deletion.

I have a template batch that lets you choose (p) and I will make 2 versions. A verbose, and silent mode.

Thank you to anyone that can contribute.


----------



## Ninjaboi (Dec 27, 2010)

This is a link on how to add/modify/delete registry keys:

[url]http://support.microsoft.com/kb/310516[/URL]

Here is a link to Windows Search 4.0, which can locate files anywhere on your PC:

[url]http://www.microsoft.com/windows/products/winfamily/desktopsearch/choose/tipsandtricks.mspx[/URL]


----------



## c_robertson (Aug 22, 2009)

I've been through that document, and many more about deleting keys. They are about keys that you know where they are. Nog searching for keywords and removing them. Forgive me if I'm wrong, but I can't see how toremove keywords.


----------



## niemiro (Feb 20, 2010)

Hello!

A few things which aren't quite clear, please bear with me 



> Batch





> programming


How do you want to do this? Easier to program, almost certainly. Which language. 

Are you planning on dealing with just keys, or values as well. Keys, value names, data (hexadecimal as well?)

Anyway, if you are confirming each one, wouldn't it be easier to just search the registry with regedit?

Otherwise, you will have to write your own methods. We can help, if necessary, if it is a language I know well enough  One word: *recursion*. 

I know this may sound daunting, but you can't just ask Windows to do it. 

You need to think carefully about your plan, and then use (C#) Microsoft.Win32.

RegistryKey.GetValueNames()
RegistryKey.GetSubKeyNames()
Registrykey.GetValue()
String.Contains()

Recurse hives. Recurse values. Recurse keys. Loop: Recurse keys and values

Do you kind of get the idea?

Thanks, and the best of luck!

Richard


----------

