Failed appendfile action csript command

(imported topic written by tigger0191)

I’m trying to build a batch file that removes some registry keys on a windows server. All the other appendfile commands work fine, but the one below produces the error further down in the BES client log when its run. Any ideas what is happening here?

--------------Action script line-----------

appendfile reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{37DEA792-A790-466E-81D4-C2E329A02700} /f

--------------Log error------------------

Command failed (Relevance substitution failed) appendfile reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{37DEA792-A790-466E-81D4-C2E329A02700} /f (fixlet 185343)

At 07:56:57 -0600 -

Any help is appreciated. I tried converting the action script to use createfile instead of appendfile and the error still occurrs.

(imported comment written by NoahSalzman)

If we ever start up a band, here in the Forum, we should name it “Escaped Curly Brace.”

http://support.bigfix.com/cgi-bin/kbdirect.pl?id=1230

Or, better yet, “Ben and the Escaped Curly Braces”.

(imported comment written by tigger0191)

Excellent! A lesson learned for life. And thank you.

Now on to another issue. How do I change the /I to a /X in the following registry value:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{AD8A1013-4E46-4E02-85C2-3168C3328432}

UninstallString=MsiExec.exe /I{AD8A1013-4E46-4E02-85C2-3168C3328432}

Here’s what I have so far:

regset "

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{AD8A1013-4E46-4E02-85C2-3168C3328432}

" “UninstallString”="{“Msiexec.exe /X” & (name of key)}"

What relevance would I use to get the name of the key (GUID) in there? Thanks for the help.

(imported comment written by tigger0191)

ok. So this returns all the names of the subkeys of the Uninstall key…

names of keys of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of the registry

Now to add the part that returns the name of the one which contains a value called DisplayValue set to “Symantec Antivirus”. If its any surprise, I sucked at algebra too. Every time I took it. :slight_smile:

(imported comment written by tigger0191)

This seems so close…but yet so far. Bad 70’s song reference there.

q: name of keys of key whose ( (value “DisplayName” of it as string as lowercase) contains “Symantec Antivirus” as lowercase) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry

E: Singular expression refers to nonexistent object.

I hope this horrific display of ineptitude is affording someone a chuckle.

(imported comment written by NoahSalzman)

Start here… and then get more specific with the name once that works:

name of key whose (value “DisplayName” of it as lowercase contains “symantec”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry

(imported comment written by tigger0191)

Thanks Noah. Here’s what ended up working:

q: name of key whose (value “DisplayName” of it as string as lowercase contains “symantec antivirus”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry

A: {AD8A1013-4E46-4E02-85C2-3168C3328432}

I’m testing this:

regset “UninstallString”=“Msiexec.exe /X” & “{name of key whose (value “DisplayName” of it as string as lowercase contains “symantec antivirus”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}”

The key name and the GUID in the UninstallString value, while the same on any given machine, are potentially different from machine to machine. I’ll post my results when I get them. Thanks for the help.

(imported comment written by tigger0191)

As a follow up, the regset command in my last post did not work. I did not persue it any further however, because a guy exited the vbs script we are using to parse out the GUID from the registry. Like this:

uninstcommand = “Msiexec.exe /X” + strHexKeyOnly + " /qn /norestart /l*v C:\OSS\LOGS\SAV\SAVuninst.log"

This worked like a charm.

(imported comment written by BenKus)

The regset didn’t work because you didn’t provide the full key path (you just gave the key name) and you also need quotes around the key name.

Ben