How do I delete registry subkeys using .reg file?

1

1

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:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist

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:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist
 {5E39430943 etc}
  Count

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.

BubbleMonster

Posted 2013-08-05T08:24:15.987

Reputation: 382

Follow the instructions in this KB from Microsoft http://support.microsoft.com/kb/310516

– NoLifeKing – 2013-08-05T08:38:26.997

Answers

1

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

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist

Enclosing it in [] so it looks like this:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist]

It will create the key.

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

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist]

Hope this helps someone else.

BubbleMonster

Posted 2013-08-05T08:24:15.987

Reputation: 382