Help! I need help with the removal of google, yahoo, and any other toolbar on a group of users computers. This is what I have so far for removing the google toolbars but it isn’t working for all relevant PCs.
Relevance:
exists keys whose (value “displayname” of it as string as lowercase contains “google toolbar” AND exists value “uninstallstring” of it) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry
Action:
wait {(value “UninstallString” of it as string & " /s") of keys whose (value “displayname” of it as string as lowercase contains “google toolbar” AND exists value “uninstallstring” of it) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}
You are probably getting a failure because your relevance brings back two registry keys instead of just one. Relevance substitution in actions cannot handle plural relevance results.
The tricky thing with Google toolbar is that there are actually two uninstall keys and only the one that is an MSI uninstall is the “right one” to uninstall the product. The second one is a dll registration and it gets removed as part of the main uninstall. The other tricky thing is that the uninstall command uses msiexec.exe /I which is actually msi speak for “install” not “uninstall”. So, if you take the uninstall line and just add a “/s” to the end, MSI does not know what to do with that flag and the uninstall will not happen.
Here is the sample code from class that handles these issues. Notice that we are using a /X instead of the /I for the MSI uninstall command. More on MSI command line wizardry here: http://technet.microsoft.com/en-us/library/cc759262.aspx
Relevance:
Exists key whose (value “displayname” of it as string = “Google Toolbar for Internet Explorer” of it and value “uninstallstring” of it as string as lowercase contains “msiexec”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry
Action:
Wait msiexec.exe /X {name of key whose (value “displayname” of it as string = “Google Toolbar for Internet Explorer” of it and value “uninstallstring” of it as string as lowercase contains “msiexec”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry} /qn
When this action script runs it ends up looking like this: msiexec.exe /X {12345678-1234-1234-1234-1234567890ab} /qn
This trick works for most MSI based installs. Setup.exe based uninstalls are a bit harder and require you to do some vendor research to identify a way of silently uninstalling.
I have not looked at uninstalling Yahoo toolbar. You will want to scan the uninstall section of the registry and try the uninstall commands you find there using the command line. From there it may be possible to build some action script to initiate the uninstall.
I don’t think this works with the newer versions of the google toolbar as they don’t appear to have msiexec in the uninstallstring. It looks like google has switched to something like
wait {value “uninstallstring” of key whose (value “displayname” of it as string = “Google Toolbar for Internet Explorer” of it and value “uninstallstring” of it as string as lowercase contains “uninstall”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}
But I don’t know if that will be silent (if it isn’t, you need to find a silent flag for the uninstall) and i didn’t test this…