Hi Sally,
try this. it works for all java version. It's, like rpoltera a vbscript. copy. save it in vbs file. Then start with admin right.
hope it help you.
' script to uninstall an application
' D clarysse
' date: 03 2013
' Version: 0.1
' it's look like windows update
' declare variable
Option Explicit
dim Message, Title, Icon, Choice, tmp, Instance, Application
dim res,Shell
Dim strComputer,oReg,UninstallKeyPath,strKeyPath,arrSubKeys,subkey,find,My_String
Dim name,newSubkey,result,oShell,UninstallString,UninstallStringKey, Popup_String
'declare const
Const HKEY_LOCAL_MACHINE = &H80000002
' declare here the application to be uninstalled
' enter the application to be uninstalled
' it tested for java and flasplayer
' the thing is the this script read
' the uninstall string in registry
' so take care if there is an uninstall string
' with msiexec /x
' be carreful to take the good string
' because the script respects the case sensitive
Application = "Java"
' Kill_Running_instance
' before uninstall something
' the script detect if there the
' application is open
' if it opens, it kills it
' for java application
' it's kills all instance of java
' for another it takes the name of instance variable
Function Kill_Running_Instance (Instance)
Set Shell = CreateObject("WScript.Shell")
if Instance = "Java" then
'WScript.Echo "kill java"
Shell.Run "taskkill /F /IM java.exe",0,true
Shell.Run "taskkill /F /IM javaw.exe",0,true 'java without console
Shell.Run "taskkill /F /IM jp2launcher.exe",0,true
Shell.Run "taskkill /F /IM jqs.exe",0,true 'java quick starter
Shell.Run "taskkill /F /IM justed.exe",0,true ' java update
else
'WScript.Echo "kill" & Instance
Shell.Run "taskkill /F /IM " & Instance,0,true
end if
Set Shell = Nothing
end function
' Kill_All_broswer_instance kills
' IE, Firefox, Chrome if started
Function Kill_All_broswer_Instance ()
'WScript.Echo "kill all Broswer"
Set Shell = WScript.CreateObject("WScript.Shell")
Shell.Run "taskkill /F /IM iexplore.exe",0,true
Shell.Run "taskkill /F /IM firefox.exe",0,true
Shell.Run "taskkill /F /IM chrome.exe",0,true
Set Shell = Nothing
end function
' Uninstall_software uninstalls
' uses the uninstall string found in registry
function Uninstall_Software(My_String)
Set Shell = CreateObject("WScript.Shell")
'WScript.Echo "Uninstall string soft:" & My_String
res = Shell.Run(My_String, 1, true)
Set Shell = Nothing
End function
'Find_and_kill_software
' try to find the application
' in registry
' then try to uninstall it
' with the uninstall string
' found in the registry
Function Find_And_Kill_Software (To_Kill)
Set oShell = CreateObject("WScript.Shell")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
UninstallKeyPath = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
name = "DisplayName"
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
newSubkey = UninstallKeyPath & subkey & "\" & name
'Need to turn on error handling just in case newSubkey doesn't exist
On Error Resume Next
result = oShell.RegRead(newSubkey)
If Err.Number = 0 Then
find = InStr(result,To_Kill)
if find then 'si different de 0 donc trouve qq chose
UninstallStringKey = UninstallKeyPath & subkey & "\UninstallString" 'copy the uninstall string
UninstallString = oShell.RegRead(UninstallStringKey)
'WScript.echo UninstallString
Uninstall_Software(UninstallString & " /qn") ' add /qn to do it silencely
End if
End If
On Error GoTo 0
Err.Clear
Next
' end for software by default
'detect if there is a 64 bites verson
strKeyPath = "HARDWARE\DESCRIPTION\System\CentralProcessor\0"
name = "Identifier"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,name,tmp
if (instr(tmp,"64")) then
'Perform functions for 64-bit OS
strKeyPath = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"
UninstallKeyPath = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"
name = "DisplayName"
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
newSubkey = UninstallKeyPath & subkey & "\" & name
'Need to turn on error handling just in case newSubkey doesn't exist
On Error Resume Next
result = oShell.RegRead(newSubkey)
If Err.Number = 0 Then
find = InStr(result,To_Kill)
if find then 'si different de 0 donc trouve qq chose
UninstallStringKey = UninstallKeyPath & subkey & "\UninstallString" 'copy the uninstall string
UninstallString = oShell.RegRead(UninstallStringKey)
'WScript.echo UninstallString
Uninstall_Software(UninstallString & " /qn") ' add /qn to do it silencely
End if
End If
On Error GoTo 0
Err.Clear
Next
'WScript.Echo "os version :" & tmp
end if
Set oShell = Nothing
End Function
' main prg
Kill_All_broswer_Instance ()
Kill_Running_Instance(Application)
Find_And_Kill_Software (Application)