Old school question...

jfall

Diamond Member
Oct 31, 2000
5,975
2
0
Does anyone know how to remove keys from the Windows Registry in a batch file. I'm trying to write a simple batch file to fix a virus, it requires removing a few keys from the registry, I want the batch file to do this, I know there is a way to do it, but I can't figure it out

Thanks
 

hominid skull

Senior member
Nov 13, 1999
971
0
0
It is possible to delete keys with a .reg file.

Just put a - before the key you want to delete and that should do it. Make sure the Key you want to delete is the one in the braces, if you want to delete multiple keys use multiple [-] commands.

You have to put REGEDIT 4 at the start of the file so it know what verison you are writing for, if it's you own machine then you don't need to worry about it(it still ahs to be in the file otherwise the registry won't be updated.).


REGEDIT4

[-HKEY_LOCAL_MACHINE\SYSTEM\KEY_YOU_WANT_TO_DELETE]


PS. make sure you backup the registry before you start messing with it.