I wanted to uninstall Java from all the machines and install the latest one. There were sometimes multiple versions of Java which had to be removed. Some machines had both 32 bit and 64 bit Java versions. Here is the easiest batch script to uninstall any version of Java on the machine.
There were scripts available but they did not delete 64 bit versions of Java and some very old versions of Java. Hence I modified those scripts to meet my need.
set mycmd=reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s /f *java*
for /f " usebackq delims={} tokens=2" %%i IN (`%mycmd%`) do (
msiexec /uninstall {%%i} /passive
)
set mycmd=reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall /s /f *java*
for /f " usebackq delims={} tokens=2" %%i IN (`%mycmd%`) do (
msiexec /uninstall {%%i} /passive
)
This Blog is for all people working or related to the MSI and App-V. There are lots of issues we face in everyday work regarding the technology. The sole purpose of my blog is to help others with whatever I learn. All you people out there, please help by commenting, voting, propagating and sharing my blog with your friends and colleagues but with due credit and acknowledgement to the material posted here with my name and blog url as I still do hold the copyright of the posts here.