Solved

Uninstall Java 32bit and 64bit using command line

Posted on 2013-06-10
5
13,502 Views
Last Modified: 2013-06-15
Hello,

I am currently responcible for making sure that my companies PC's have the latest and greatest patches and updates for all windows, adobe, and java applications. We have approximately 2000+ PC's and Laptops. I am trying to find an easier way to do a silent uninstall of all installed versions of Java. This includes uninstalling 32bit and 64bit editions in one scirpt. The script I was using before works great if the PC only has 32bit versions installed, but if a 64bit version is installed it doesnt work. I found out that I could use a command script to do this.

wmic product where "name like 'Java%'" call uninstall /nointeractive

This would remove any and all editions/versions of Java, allowing me to install only the latest version. This worked for most of my PC's but on alot of them I get an ERROR: Description = Generic failure. This also happens when I try to run it manually on the PC. Is there a way to fix this or if someone knows how to create a VB script that will find and remove all versions of Java 32bit and 64bit in one pass?

We are using Windows 7 Enterprise 64bit. Please let me know if you need anymore additional detail in order to assist me to trying to find a solution for this.

Thank You,
AG
0
Comment
Question by:Techie_Guru
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:PaulNSW
ID: 39236954
This is what I used to removed all old Java versions.

There is a summary at
http://iampaulh.blogspot.no/2012/09/script-to-remove-all-java-plugins.html

with the main code coming from comments section at
http://www.itninja.com/question/silent-uninstall-java-all-versions
0
 

Author Comment

by:Techie_Guru
ID: 39239734
I will give this a try and let you know if it works.

Thank You for the links.


***Update***
The script didnt work. It looks to run succesfully but the old editions were still installed.
Any idea how to fix the WMIC command from having a generic error? I would perfer to use this method of uninstalling.
0
 
LVL 7

Accepted Solution

by:
PaulNSW earned 500 total points
ID: 39240174
What error code did you get when you ran the it in a command window?

I just tried it now, and it worked perfectly!

Copy the file to your computer (eg c:\scripts), open up an administrative command prompt then type

cscript "c:\scripts\javaremove.vbs" /logfilepath:"%userprofile%"

Open in new window


javaremove.vbs

You should get something like this:

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

**********************************
Java uninstall script started at 12/06/2013 08:02:10

----------------------------------
Script parameters:
Specified Java versions found will be kept. Other versions will be removed.
No native Java versions specified on the command line.
No x86 Java versions for x64 systems specified on the command line.
Using specified native verions for x86 also.
Uninstall log file path: c:\tools\.
----------------------------------

----------------------------------
Checking for problematic processes.
Finished problematic process check.
----------------------------------

----------------------------------
Found version: Java 7 Update 21 (64-bit)
Found at: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F86417021FF}
Uninstall string: MSIEXEC.EXE /X {26A24AE4-039D-4CA4-87B4-2F86417021FF} /qn /norestart /l*v "c:\tools\Java 7 Update 21 (64-bit)_Uninstall.txt"
Uninstall return code was: 0.
----------------------------------

----------------------------------
Found version: Java 7 Update 21
Found at: HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83217021FF}
Uninstall string: MSIEXEC.EXE /X {26A24AE4-039D-4CA4-87B4-2F83217021FF} /qn /norestart /l*v "c:\tools\Java 7 Update 21_Uninstall.txt"
Uninstall return code was: 0.
----------------------------------

Java uninstall script finished at 12/06/2013 08:02:27
**********************************

Open in new window

0
 

Author Comment

by:Techie_Guru
ID: 39250537
Thank you for the feedback. The script appears to work perfectly when I run it from command prompt. Is it possible to have it run silently? The issue I have now is trying to get it to work from Altiris Deployment Server.

I may have to figure this one out on my own but Thank You so much for that script. Does exactley what I needed.
0
 

Author Closing Comment

by:Techie_Guru
ID: 39250539
Found and removed all versions and editions of java without any errors.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Read some really old .pic files??? 18 62
internet fax? 7 28
Is Fedora an appropriate distro for the environment. 7 93
VMware-ClientIntegrationPlugins 6 83
OfficeMate Freezes on login or does not load after login credentials are input.
All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question