Solved

Remotely uninstall Java?

Posted on 2008-06-23
11
1,848 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
  • 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
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now