Saved for later reference

online repository of stuff I had to google for hours to figure out – and random snippets of code

Automated uninstall of Java JRE

Tags: , , , , , ,

Recently I had to uninstall Java from a computer that had 5 different versions installed, and after some searching, and more time spent trying and failing than it strictly would take to manually uninstall each version, I ended up with the following .cmd file:

1
2
3
4
5
6
7
@echo off
echo Uninstalling old Java 6
wmic product where "name like 'Java(TM) 6%%'" call uninstall /nointeractive
echo Uninstalling old Java 7
wmic product where "name like 'Java 7%%'" call uninstall /nointeractive
echo Uninstalling old JavaFX
wmic product where "name like 'JavaFX %%'" call uninstall /nointeractive

It should be fairly obvious what these lines do, and how to extend it to uninstall other products, I think!

Bonus command line to silently install JRE without ASK toolbar:

1
jre-7u13-windows-x64.exe /s

Added 2013-06-22: See also this article on preventing Ask toolbar from installing.

Share

© 2009 Saved for later reference. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.