Solved

Remotely uninstall Java?

Posted on 2008-06-23
11
1,860 Views
Last Modified: 2013-12-29
I have to deploy an application that requires the use of Java 5.10. The vendor told me that there can't be any versions of Java on the client PCs that's later than 5.10. There are 70 PCs that's going to need to run this new application and obviously I don't want walk to 70 PCs to do this manually. Is there a way through a login script or a freeware tool that I can automate the task of uninstalling all versions of Java on these computers? Java is part of our standard image and was installed through the online installation via Sun's Web site. Unfortunately, there may be several different versions of Java on these PCs as well. Thank you.
0
Comment
Question by:mcpp661
[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
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 21847891
>>The vendor told me that there can't be any versions of Java on the client PCs that's later than 5.10.

Did they say why btw?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21847944
>>Java is part of our standard image and was installed through the online installation via Sun's Web site

If you definitely are only able to run the earlier version of Java, it would probably be easier to re-image your workstations with the early version
0
 
LVL 14

Accepted Solution

by:
agriesser earned 500 total points
ID: 21847977
Maybe this link helps?
A user wrote a small script to automatically uninstall all existing java versions installed on a windows machine (untested by me):

http://forum.java.sun.com/thread.jspa?threadID=692662
0
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.

 
LVL 86

Expert Comment

by:CEHJ
ID: 21848151
Personally i would be wary of using anything less than the highest grade software to automate uninstallation. In comparison to fixing scores of hosed registries, manual uninstallation from 70 workstations could seem like a positive joy
0
 

Author Comment

by:mcpp661
ID: 21848205
Well, the vendor's application won't work with later versions of Java. I have no option there. Also, re-imaging all of those PC would take longer than just uninstalling them and installing only the required version.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21848270
Well imaging PCs is usually automated after the master image has been made, hence my suggestion
0
 
LVL 14

Expert Comment

by:agriesser
ID: 21848319
Can you summarize the installed Java versions on your 70 workstations?
If so, you would at least no which automated uninstallers to start...
0
 

Author Comment

by:mcpp661
ID: 21848394
Unfortunately, I can't. This was done before I arrived on the scene and have no documentation. I tested the scripts from the forum link you gave me and they aren't working. I just copied and pasted them from the Web site into Notepad files and gave them the appropriate file extensions. I corrected what I thought were syntax errors but it's still not working. Not sure what I'm not doing right.
0
 

Author Closing Comment

by:mcpp661
ID: 31469831
Actually, this will work, I'm just having an issue with the syntax of the VBScript and that's why it's not working for me. I know once I get that fixed my issue will be resolved. Thank you.
0
 
LVL 14

Expert Comment

by:agriesser
ID: 21849833
I fixed the VBscript and tested in on some systems.
It managed to uninstall all java versions that were installed using MSI installer technology.
I've no 1.3 JREs installed anymore so I couldn't test them but according to the link I posted above, you need to prepare answer files for these old installers.
'<start>
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Const ForReading = 1, ForWriting = 2
 
'Open the exported registry file
Set MyFile = fso.OpenTextFile("c:\temp\uninstall.tmp", ForReading)
 
Do While MyFile.AtEndOfStream <> True
ReadLineTextFile = MyFile.ReadLine
Uninstall = ReadLineTextFile
CLSID = Mid(Uninstall, 73, 38)
On Error Resume Next
 
'DisplayName
DisplayName=WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & CLSID & "\DisplayName")
 
'Publisher
Publisher=WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & CLSID & "\Publisher")
 
'Search for presence of Java and Sun in DisplayName and Publisher
search1 = Instr(1, DisplayName, "Java", 1)
search2 = Instr(1, Publisher, "Sun", 1)
 
'Execute removal if there is a match
Uninstaller="MsiExec.exe /X"&CLSID+" /QN"
if search1>0 And search2>0 Then Return = WshShell.Run(Uninstaller , 1, TRUE)
 
Loop
'<end>

Open in new window

0
 

Expert Comment

by:UBB
ID: 34135327
hello agriesser,

I have a question, the link you gave above worked but is no longer availible so I Need the command line for using PSEXec with wscript to do this

I forgto the command

please help

thanks
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

734 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