Uninstalling previous Java versions can be cumbersome with over 50 different registry codes. Leveraging WMI within a task sequence is a much simpler and efficient approach.
Create a task sequence under APPS
Add – General – Run Command Line
enter the following as the command line:
cmd.exe /C START /WAIT /MIN WMIC product where "Name LIKE 'J2SE Runtime%%'" call uninstall /nointeractive
Add – General – Run Command Line
enter the following as the command line:
cmd.exe /C START /WAIT /MIN WMIC product where "Name LIKE 'Java 6 Update%%'" call uninstall /nointeractive
Add – General – Run Command Line
enter the following as the command line:
cmd.exe /C START /WAIT /MIN WMIC product where "Name LIKE 'Java(TM) 6 Update%%'" call uninstall /nointeractive
Add – General – Run Command Line
enter the following as the command line:
cmd.exe /C START /WAIT /MIN WMIC product where "Name LIKE 'Java 7 Update%%'" call uninstall /nointeractive
Add – General – Run Command Line
enter the following as the command line:
cmd.exe /C START /WAIT /MIN WMIC product where "Name LIKE 'Java(TM) 7 Update%%'" call uninstall /nointeractive
Add – General – Run Command Line
enter the following as the command line:
cmd.exe /C START /WAIT /MIN WMIC product where "Name LIKE 'Java 8 Update%%'" call uninstall /nointeractive