Solved

Remotely uninstall Java?

Posted on 2008-06-23
11
1,862 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Learn about cloud computing and its benefits for small business owners.
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

630 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