Solved

Remotely uninstall Java?

Posted on 2008-06-23
11
1,855 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
allswap challenge 6 99
check java version using powershell 13 93
Downgrade From Domain to WorkGroup 3 42
Desingning Refactoring existing code 2 24
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.

810 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