Deleting an entire Reg key with a {GUID}

I made a reg file to remove one entry completely… (among other things)

Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Active Setup\Installed Components\{BABAE22B-E93F-4480-BA04-33376F598A41}]

Works fine by hand… I therefore prefetch it and run it from __download via regedit, as is… With bigfix the key does not get deleted… I did specify the wow6432node in the path… So I tried Wow redirection true AND false… Neither did it. I’m not building the reg file in action script so I did not escape { in the file… Should I ? Ideas ?

as another method

reg delete "HKLM\SOFTWARE\Wow6432Node\Microsoft\Active Setup\Installed Components" "{BABAE22B-E93F-4480-BA04-33376F598A41}" /f

There is an actionscript command for this. regdelete and regdelete64. They both work similarly, but regdelete64 disables redirection first.

http://www-01.ibm.com/support/knowledgecenter/SS63NW_9.0.0/com.ibm.tem.doc_9.0/Platform/Action/c_regdelete64.html


Also, I wouldn’t recommend uploading and downloading a small script like that. You should use the create file command instead.

1 Like

Thanks guys. Will try both… (edit: the dos version fails everytime, tried 3 times with different syntax, I wonder if the guid’s curly braces are messing things up)

@jgstew : I just realized while reading other posts you don’t even work for IBM ? Damn, thanks a lot for helping out on the forum like you do !!!
I thought the regdelete and regdelete64 only worked if you supplied a value under the key. I want to delete the entire key, whose name goes all the way to the GUID in curly braces (and all the values under it)

PS: I am doing a lot more than just the delete in the reg file, but the delete portion failed to do anything… As a rule over the years I’ve seen strange things not work when scripted in actions (possibly due to a locked down environment), while importing files (reg or script) and executing locally pretty much always worked (until now). That’s why I kinda stick with it by default.

1 Like

This is what worked, finally. Escaping the damn { for relevance reasons combines with the dos command…

dos reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Active Setup\Installed Components\{{BABADB22B-E93F-4480-BA04-33376F598A41}" /f
1 Like

Yes, that is correct.

I was just going to add that the { needs escaped.

:smile: That is correct. I just use BigFix quite a lot and I find the forums beneficial. I learn as much answering questions as I do asking them. In many cases I don’t actually know the answer until I answer it.

1 Like

Any idea how I can add in the extra curly brace to get this to work?

Q: concatenation "%0d%0a" of (("reg delete %22" & pathname of it & "%22 /f") of keys whose (value "DisplayName" of it as string starts with "WinZip") of key  "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of native registry)

A: reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{CD95F661-A5C4-44F5-A6AA-ECDD91C24105}" /f

You don’t need an extra curly brace when outputting one with relevance substitution. You only need it to prevent relevance substitution, which doesn’t apply when it is the result of a substitution.

That said, you might try this:

concatenation "%0d%0a" of (("reg delete %22" & pathname of it & "}%22 /f") of keys whose (value "DisplayName" of it as string starts with "WinZip") of key  "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of native registry)

but again, this probably isn’t needed, and if not needed, then it won’t work properly. It isn’t clear to me when you must escape a bracket on a particular side, but I do know it works on either side depending on the case.

I kept getting an error (Exit Code=1) when I ran that script, so I thought adding an extra curly brace before or after it may solve the issue, but it did not.

By the way, the added curly brace character as you added in before %22 doesn’t work, which is why I asked how to. But I figured it out… using “%7d” works (but doesn’t solve the issue why WinZip registry key doesn’t delete).

Anyway, thanks for the help!

1 Like

Doh! forgot to use this:

action uses wow64 redirection {NOT x64 of operating system} 

Issue solved, and Yes, the extra curly brace was not required

1 Like

I did figure escaping the } would be required but I didn’t have it handy. I should have specified that.

Definitely important to try that when things don’t work the way you expect. WoW redirection is always an annoying complication that is hard to deal with when you are not certain what the specific issue is.