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.



0 Comments   [ + ] Show Comments


Please log in to comment

Community Chosen Answer


Quick and dirty:



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
WshShell.Run "regedit /s \\path to reg file\", 1true
WshShell.Run "msiexec /i \\path to java7\ /qb-"

be sure to adasdd that "-" infront of the regfiles to be deleted.


Answered 06/07/2013 by: areiner
Fourth Degree Black Belt

  • 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.
  • 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
  • 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.
Please log in to comment




Answered 06/07/2013 by: SMal.tmcc
Red Belt

  • http://www.itninja.com/link/batch-script-to-list-all-java-product-and-uninstall-keys
  • SMal.tmcc: Thanks a lot for the help mate. But my company doesn't really want me to use batch files. But thanks for the help man.
Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja