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?
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.
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.
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
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.
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: