Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1868
  • Last Modified:

Remotely uninstall Java?

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
mcpp661
Asked:
mcpp661
  • 4
  • 3
  • 3
  • +1
1 Solution
 
CEHJCommented:
>>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
 
CEHJCommented:
>>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
 
agriesserCommented:
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
CEHJCommented:
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
 
mcpp661Author Commented:
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
 
CEHJCommented:
Well imaging PCs is usually automated after the master image has been made, hence my suggestion
0
 
agriesserCommented:
Can you summarize the installed Java versions on your 70 workstations?
If so, you would at least no which automated uninstallers to start...
0
 
mcpp661Author Commented:
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
 
mcpp661Author Commented:
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
 
agriesserCommented:
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
 
UBBCommented:
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

Technology Partners: 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!

  • 4
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now