Uninstall older versions of Java.
Hi Guys,
I know this question has been going around for quite some time. And I know there are many uninstall vbscripts that can do that. But couple of questions to ask.
1) Is there a script that can uninstall JRE 1.6 along with the files in Program data. As when i try to uninstall using the uninstall string it leaves back some of the registries and files which becomes a problem when qualys is trying to do a report. If it sees anything regarding JRE 6 it raises a flag that says u have a older version of Java.
2) Is there any script that does uninstall the older versions of Java and all the files relating to Java. I have tried to embedd a vbscript in the transform of JRE 1.7. It does not do anything.
If at all if you guys have a script that uninstalls older version of Java and remove all the files of JRE 6. Can you help me please.
Thanks a lot in advance.
Sid
Answers (2)
Quick and dirty:
On Error Resume next
Dim WshShell
Dim fso
Set fso = WScript.CreateObject("Scripting.Filesystemobject")
Set WshShell = WScript.CreateObject("Wscript.Shell")
WshShell.Run "msiexec /X{26A24AE4-039D-4CA4-87B4-2F83216029FF} /qb-", 1, True
fso.DeleteFolder("YOUR PATH TO JAVA FOLDERS YOU WANT DELETED"), 1, True
WshShell.Run "regedit /s \\path to reg file\", 1 true
WshShell.Run "msiexec /i \\path to java7\ /qb-"
WScript.Quit
be sure to adasdd that "-" infront of the regfiles to be deleted.
[-HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]
Comments:
-
Hey Ariner,
That was a good one. But is there any way that we can actually do something like a conditional statement where it checks for the registry and delete it. Since it doing to be used on different machines and we are not really sure what version of Java is not installed on the machine. Over all the script that you gave me is nice. - Sidhugadu 11 years ago -
Are you able to pull a software inventory of all the versions of java installed? If so you could do an If/then statement for all of those particular folder in Program Files - areiner 11 years ago
-
I do have the inventory of all the versions of JRE. And it is just version 6 that I need to uninstall. But the folder and the registries that I want to delete are the same. But thanks a million Mate. - Sidhugadu 11 years ago
http://www.itninja.com/blog/view/how-to-create-your-own-uninstall-strings-for-all-versions-of-java-6-and-7