Jump to content


  • 0

Question

My client computers are running windows xp and some are running windows 7. I can deploy java with no problems.

 

I want to uninstall all the other versions of java on the systems, send out the java and have java updates disabled. I have see different sites with vbs and bat files to uninstall java, but none of them worked when I tried the files on a test environment.

 

 

Please help

 

Thank You

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I cant take credit for this script. I found it some place but it is one of the best VB scripts I have used for removing Java. It will remove all versions except for 7u7. Short and sweet just how I like it. Now if I can just find the command to disable auto update.

 

'Start Script

On Error Resume Next

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

'Uninstall Java 2 Runtime Environment, J2SE Runtime Environment

Set colJava4dot3 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java 2 Runtime Environment Standard Edition %'")

For Each objSoftware in colJava4dot3

objSoftware.Uninstall()

Next

 

'Uninstall Java 2 Runtime Environment, J2SE Runtime Environment

Set colJava4dot3 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'J2SE Runtime Environment %'")

For Each objSoftware in colJava4dot3

objSoftware.Uninstall()

Next

'Uninstall Java 2 Runtime Environment, SE *

Set colJava4dot3 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java 2 Runtime Environment, SE %'")

For Each objSoftware in colJava4dot3

objSoftware.Uninstall()

Next

'Uninstall Java 6 Update *

Set colJava6dot = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java 6 Update %'")

For Each objSoftware in colJava6dot

objSoftware.Uninstall()

Next

'Uninstall Java 7 Update *

Set colJava6dot = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java 7 Update %'")

For Each objSoftware in colJava6dot

objSoftware.Uninstall()

Next

'Uninstall Java 7 *

Set colJava7 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java %'")

For Each objSoftware in colJava7

objSoftware.Uninstall()

Next

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.