Delete registry folder

i am new to BF and want to create a fixlet to delete a folder in the registry.

Go to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run key
Find Logitech Download Assistant and delete the entry

thanks for the help

Adam

You should be able to make some kind of relevance like:

exists value “Logitech Download Assistant” of keys “HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run” of native registry

and then a command to delete it:

// For 32Bit
if {not x64 of operating system}
regdelete “[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]” "Logitech Download Assistant"
endif

// For 64Bit
if {x64 of operating system}
regdelete64 “[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]” "Logitech Download Assistant"
endif

2 Likes

Assuming “Logitech Download Assistant” is the name of a value, there are a few considerations here.

Bigfix is a 32-bit application, and trying to access key "HKEY_LOCAL_MACHINE\Software" of registry in relevance will actually be redirected to HKEY_LOCAL_MACHINE\Software\Wow6432Node. This can be avoided by using the of native registry or of x64 registry inspectors instead.

When the Action runs, it likewise spans 32-bit binaries for actions like wait reg.exe. This can be avoided by using action uses wow64 redirection false in the script.

Try the following on a test system

Relevance:
windows of operating system AND (exists values "Logitech Download Assistant" of keys "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" of native registry

Action:

action uses wow64 redirection false

waithidden reg.exe delete "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" /v "Logitech Download Assistant" /f
2 Likes

I’d also recommend checking out the Windows Registry Wizard for such use cases as well: How to add value in registry

Do people prefer using the reg add/delete over the bigfix reg commands? I seem to make half my fixlets either way for some reason.

I usually prefer the reg.exe method, but them I’m often usually deleting multiple keys at once.

I don’t know of a method to specify a plural number of keys to delete via the native BigFix commands, but I can create an appendfile for multiple “reg.exe” command lines via relevance.

action uses wow64 redirection false
delete __appendfile
appendfile {concatenation "%0d%0a" of ("reg.exe delete %22" & pathname of it & "%22 /F") of keys whose (value "DisplayName" of it as string contains "Applications I want to remove") of keys "HKLM\Software\Microsoft\Windows\Uninstall" of native registry}
move __appendfile deletereg.cmd
waithidden cmd.exe /c deletereg.cmd

As I’m using that method so frequently, I generally use the ‘reg.exe’ command even where I don’t necessarily need it.

There is a side-effect if you have a huge number of fixlets doing this in a baseline though. Each callout to wait or waithidden has some delay, the action script doesn’t immediately know when the command has finished; it may take fifteen or thirty seconds before moving on to the next line of actionscript.

1 Like