Using WMI to remove software with wildcard or variable names?

N

net1994

Hello all – We have multiple versions of teamviewer software on multiple PCs. I need to get rid of them all (about 1500 installs) and using WMI commands is a good bet it seems like. I don’t want to create long scripts with MSI Product code uninstall strings and what not. On our PCs. Installed TeamViewer is a mix of versions and products. In Add/Remove programs, it might be:


TeamViewer Host

TeamViewer 6

TeamViewer 13

TeamViewer



As there are multiple ways to remove each version, I’d like a ‘catch all’ using a common variable and WMI commands. I can do a simple task kill on the running EXE and to close the running program. So, I thought to use:


wmic product where "name like 'TeamViewer%%'" call uninstall


I ran the above with admin creds on a local pc with ‘TeamViewer 6’ installed. However, it says no instance found, even though it’s in Add/Remove programs. Can you see a syntax error with that command line?

Continue reading...
 
Back
Top Bottom