Uninstall old version of Java and reinstall new

Reading Time: < 1 minute

The below script, uninstalls versions: Java 6 29, Java 6 27, Java 6 26 and Java 7 5

It then installs Java 7 10 (currently the latest version as of 20/12/2012)

Please amend last line as required, amending path to latest version of Java. for latest offline version visit http://java.com/en/download/manual.jsp

Copy the script to notepad and rename to a .bat file, example UpgradeJava.bat

To locate the GUID of java versions (e.g..26A24AE4-039D-4CA4-87B4-2F83216029FF) open command prompt on a machine and type wmic product list and press entrer. Wait for a minute, locate the java versions and GUID and add to the below script if the version is not alreadty there.

Now you can either run this manually or apply via group policy (startup script). Allow 20 mins and reboot machine, may need to reboot a couple of times if replication is still occuring around the network.

JAVAUPDATE=0 on the last line ensures users are not prompted with the upgrade java prompt when a new version is released.

Always test, before rolling out to a live environment.

When a new version is released add the previous version to be uninstalled (locate the

Easy and works great!
@echo off
REM next line uninstalls Java 6u29 X86
msiexec /X{26A24AE4-039D-4CA4-87B4-2F83216029FF} /qn REBOOT=ReallySuppress

REM next line uninstalls Java 6u27 X86
msiexec /X{26A24AE4-039D-4CA4-87B4-2F83216027FF} /qn REBOOT=ReallySuppress

REM next line uninstalls Java 6u26 X86
msiexec /X{26A24AE4-039D-4CA4-87B4-2F83216026FF} /qn REBOOT=ReallySuppress

REM next line uninstalls Java 7u5 X86
msiexec /X{26A24AE4-039D-4CA4-87B4-2F83217005FF} /qn REBOOT=ReallySuppress

REM next line Installs Java 7u10 X86 and creates a LOG file.
\\servername\share\java\JavaVersion710\jre-7u10-windows-i586” /s IEXPLORER=1 MOZILLA=1 /L C:\javaupdate7u10.log REBOOT=ReallySuppress JAVAUPDATE=0

(When copyinh the above script, may need to reenter the speech (“) marks

If you have a mix of 32 and 64 bit machines add 64 bit machines to the script

Download offline version of Java at http://java.com/en/download/manual.jsp

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.