O seguinte é o que usamos, funciona bem como um script de inicialização:
on error resume next
dim WshShell
dim RegKey
dim ScriptVerKey
Set WshShell = CreateObject("WScript.Shell")
'checks to see if registry key exists, if it does, the cleanup runs.
RegKey = "HKLM\SOFTWARE\EDU\Cleanup\"
ScriptVerKey = WshShell.RegRead(RegKey & "JAVAOldVer")
if ScriptVerKey <> "1" Then
Cleanup()
Else
WScript.Quit
End If
Sub Cleanup()
' Uninstall Java 1.4.1.01
WshShell.Run "msiexec /x {1666FA7C-CB5F-11D6-A78C-00B0D079AF64} /q",1,True
' Uninstall Java 1.4.2.04
WshShell.Run "msiexec /x {7148F0A8-6813-11D6-A77B-00B0D0142040} /q",1,True
' Uninstall Java 5.0.2
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150020} /q",1,True
' Uninstall Java 5.0.4
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150040} /q",1,True
' Uninstall Java 5.0.5
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150050} /q",1,True
' Uninstall Java 5.0.6
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150060} /q",1,True
' Uninstall Java 5.0.7
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150070} /q",1,True
' Uninstall Java 5.0.10
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150100} /q",1,True
' Uninstall Java 5.0.11
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150110} /q",1,True
' Uninstall Java 5.0.12
'WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0150120} /q",1,True
' Uninstall Java 6.0.0
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0160000} /q",1,True
' Uninstall Java 6.0.1
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0160010} /q",1,True
' Uninstall Java 6.0.2
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0160020} /q",1,True
' Uninstall Java 6.0.5
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0160050} /q",1,True
' Uninstall Java 6.0.30 (020608)
WshShell.Run "msiexec /x {3248F0A8-6813-11D6-A77B-00B0D0160030} /q",1,True
'regkey below stops the script from running again
WshShell.RegWrite "HKLM\Software\EDU\", "Default"
WshShell.RegWrite "HKLM\Software\EDU\Cleanup\", "Default"
WshShell.RegWrite "HKLM\Software\EDU\Cleanup\JAVAOldVer", 1, "REG_SZ"
End Sub