How do I delete registry subkeys using .reg file?

Posted on


I’m creating a .reg file that will delete certain subkeys. So, just for an example, say I want to delete the ‘Count‘ subkey, which is located here:


There are two subkeys in the user assist folder that look like this:

{5E39430943 etc}

Inside that, lies the ‘Count’ subkey. So the structure is like this:

 {5E39430943 etc}

I’m not 100% sure, but I think the second key MIGHT be a variable, that is, different on each computer.

So how would my registry file look if I wanted to delete that subkey but there was a variable parent key above?

Thanks in advance.


I found that it’s not a variable and that if you simply type in the key you want to create in the .reg file e.g


Enclosing it in [] so it looks like this:


It will create the key.

To delete the key, there should be a minus before the key, like this:


Hope this helps someone else.

Leave a Reply

Your email address will not be published.