Remove Registry Key

Hello,

Looking to remove a registry key out of everyone within HKEY_USERS". I found some starting fixlet with dos reg delete “HKEY_USERS” &"\Software\Clients\StartMenuInternet\Firefox*"

The key that needs to be deleted is located one everyone’s registry under \Software\Clients\StartMenuInternet\Firefox.

HKEY_USERS is a bit more challenging… Best to first try the Windows Registry Wizard in the BES Console.

Yeah reaching inside HKCU is challenging with bigfix (or so my experience has been). We typically do that w/ gpo.

You can set action execution parameters to run in the context of the current user (only when user logged on, all users, etc), but this simple explanation won’t account for your environment.

1 Like

The approach I’ve used for this is to parse all the HKU keys for the value/key you want to delete then store it as a parameter which you then send to a reg delete command.

if{exists keys "SOFTWARE\YourKey\" whose (exists value "YourValue" of it) of keys of key "HKU" of registry}
	parameter "keys1" = "{"%22" & (concatenation "%22,%22" of (pathnames of keys "SOFTWARE\YourKey" whose (exists value "YourValue" of it) of keys of key "HKU" of registry)) & "%22"}"
	waithidden cmd.exe /c "for %a in ({parameter "keys1"}) do (reg delete %a /v "YourValue" /f)"
endif

Depending on the key, you may or may not need to inspect the 32 and 64 bit registry hives.

2 Likes