Sysprep error updating registry xp Skype chat sex mumbai

Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & str JRE1 & "\Display Name") On Error Goto 0 'Search for presence of Java and Sun in Display Name and Publisher search1 = Instr(1, str Display Name, "Java", 1) search2 = Instr(1, str Publisher, "Sun", 1) search3 = Instr(1, str Display Name, "J2SE", 1) search4 = Instr(1, str Uninstall String, "setup.exe", 1) search7 = In Str(1, str Display Name, "Development", 1) In Str(1, str Display Name, "Java DB", 1) If str JREUninstall String "" Then bl Found = True '# JRE 1 found str JREUninstall String NEW = Replace(str JREUninstall String," -f"," -s -a /s /f") ts. Write Line Now() & " - Uninstall String sent: " & str JREUninstall String NEW ret = wsh Shell. Write Line Now() & " - Return: " & ret If ret 0 Then '# Old Install Shield setup found Set ts ISS = fso. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & str JRE1 & "\Uninstall String") str JREDisplay Name = wsh Shell. Expand Environment Strings("%temp%") & "\Log\" If Not fso. Create Folder(str Log Path) str Log File = str Log Path & "Apache_Uninstall_" & str Computername & ".log" WScript. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & CLSID & "\Uninstall String") str Display Version = wsh Shell.

Open Text File(str Temp ISS & "\" & CLSID & ".iss", 2, True) 'Create Response file for any Java Version ts ISS. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & str JRE1 & "\Display Name") Dim wsh Shell, fso, str Log Path, s Temp, str Temp Dir, str Temp ISS, ts In, str Uninst Line, CLSID, search5, search6, str JRE, str Publisher Set wsh Shell = Create Object("WScript. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & CLSID & "\Display Version") WScript.

Run(JREUN , 1, TRUE) End If 'Search for presence of Java and Sun in Display Name and Publisher search1 = Instr(1, Display Name, "Java", 1) search2 = Instr(1, Publisher, "Sun", 1) search3 = Instr(1, Display Name, "J2SE", 1) search4 = Instr(1, Uninstall String, "setup.exe", 1) 'Execute removal if there is a match Uninstaller="Msi /X"&CLSID " /QN" if search1 0 Then ts.writeline Uninstaller Set iss = fso. I will be using a version of your script: can you tell me if you've found any problems with it in the wild since you posted it? Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & CLSID & "\Display Version") str Publisher = wsh Shell. Write Line "Name=Java 2 Runtime Environment, SE v1.4.0_01" ts ISS. I would have retrieved the registry settings directly using the std Reg Prov.

Create Text File(Temp ISS & "\" & CLSID & ".iss") 'Create Response file for any Java Version iss.writeline "[Install Shield Silent]" iss.writeline "Version=v6.00.000" iss.writeline "File=Response File" iss.writeline "[File Transfer]" iss.writeline "Overwritten Read Only=No To All" iss.writeline "[" & CLSID & "-Dlg Order]" iss.writeline "Dlg0=" & CLSID & "-Sprintf Box-0" iss.writeline "Count=2" iss.writeline "Dlg1=" & CLSID & "-File Transfer" iss.writeline "[" & CLSID & "-Sprintf Box-0]" iss.writeline "Result=1" iss.writeline "[Application]" iss.writeline "Name=Java 2 Runtime Environment, SE v1.4.0_01" iss.writeline "Version=1.4.0_01" iss.writeline "Company=Java Soft" iss.writeline "Lang=0009" iss.writeline "[" & CLSID & "-File Transfer]" iss.writeline "Shared File=Yes To All" If search4 0 Then ss = Left(Uninstall String,search4 9) setupuninstal = ss & Un String & Chr(34) & Temp ISS & "\" & CLSID & ".iss" & Chr(34) ts.writeline setupuninstal Return = Wsh Shell. Delete Folder(Temp Dir)I can see you posted this a year ago, but I've only just found it. Muadip - I've tested your script and it worked on Win7x86 but it didn't work on Win7x64 because the Registry settings are different (Wow6432Node). I have a install base with all manner of ancient JREs. Dan [1] As of 03/18/09 it is version 6.0.120 [sigh...] Whilst not wishing to belittle anybody's efforts, the script - while undoubtedly pretty and effective - is, like so many I see, almost completely without error-trapping. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & CLSID & "\Publisher") str Uninstall String = wsh Shell. I only shelled out in this sub to retain the same format used by muaddip in his original effort.

1 if an exit code from one the uninstalls was not 0 or 3010 (reboot required). Collins - 18/02/2009 '# Uninstalls any and all versions of Java Runtime. Create Folder("C:\Logs") str Log File = "C:\Logs\Java_Uninstall_" & str Computername & ".log" Set ts = fso. Pre Flight() '# Kill Java Processes Kill Proc() str Temp Dir = wsh Shell. Close str Setupexe = Left(str Uninstall String, search4 9) str Uninst CMD = str Setupexe & str Un String & Chr(34) & str Temp ISS & "\" & CLSID & ".iss" & Chr(34) End If ts. Quit(q Val) Sub Pre Flight() '# Creates temp files containing extracts from registry 'Uninstall' keys. Run "cmd /c type %temp%\| find /i ""]"" %temp%\", 0, True If Not fso. Write Line Now() & " - No input - %temp%\Reg extract not created." ts. '# If the current version is not installed, it installs it from the specified path. '# Option Explicit Dim wsh Shell, fso, str Log File, ts, str Temp Dir, str Temp ISS, str Un String, ts In Dim str Uninst Line, CLSID, search5, search6, search7, str JRE1, str Display Name, str Display Version Dim str Publisher, str Uninstall String, str JREUninstall String, str JREDisplay Name Dim search1, search2, search3, search4, str JREUninstall String NEW, ret, str Uninst CMD Dim ts ISS, str Setupexe, q Val, str Computername, str Current Version, str Install MST Dim search Cur Ver, Cur Ver Found, str Array Count, str Log Path, str Install CMD, str Install MSI, str Install Log Dim array JREDisplay Name() Dim array JREUninstall String() '# Change this to match the version that you don't want to have it uninstall str Current Version = "Java(TM) 6 Update 13" '# Set these to the desired log path and current version installer location str Log Path = "[Log Path]" str Install MSI = "[Server Path]\JRE1.6.0_13\jre1.6.0_13.msi" str Install MST = "[Server Path]\JRE1.6.0_13\jre1.6.0_13.mst" q Val = 0 str Array Count = 0 Re Dim array JREDisplay Name(str Array Count) Re Dim array JREUninstall String(str Array Count) Set wsh Shell = Create Object("WScript. Expand Environment Strings("%temp%") str Temp ISS = str Temp Dir & "\iss" str Un String = " -s -a /s /f1" Set ts In = fso. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & CLSID & "\Display Name") str Display Version = wsh Shell. Write Line Now() & " - Current version, " & str Current Version & ", found." ts. Run "Taskkill /F /IM /T", 0, True End Sub Hello, First I wanted to thank you guys for this script. Some return codes will try to perform the installation again, other give the SMS a failed message and other return a successfully! I suggest that you, and indeed anyone using these scripts, tests, tests, tests and tests again before rolling any version of this script out to your live estate. '# Galen Dobbs - 23/03/2009 '# Uninstalls all but the chosen version of Java Runtime. Expand Environment Strings("%COMPUTERNAME%") '# Set this to the appropriate command line settings to do a silent MSI install str Install Log = str Log Path & "Java_Install_" & str Computername & ".log" str Install CMD = "msiexec /I """ & str Install MSI & """ /t """ & str Install MST & """ /QN /Lime """ & str Install Log & """" If Not fso. Create Folder(str Log Path) str Log File = str Log Path & "Java_Uninstall_" & str Computername & ".log" Set ts = fso. Pre Flight() '# Kill Java Processes Kill Proc() str Temp Dir = wsh Shell. Read Line CLSID = Mid(str Uninst Line, 73, 38) search5 = Instr(str Uninst Line, "JRE 1") search6 = Instr(str Uninst Line, "]") If search5 0 Then str JRE1 = Replace(Mid(str Uninst Line, search5, search6),"]","") End If On Error Resume Next str Display Name = wsh Shell. Writeline Now() & " - Current Version: " & str Current Version & " found, continuing with uninstalls..." For I = LBOUND(array JREDisplay Name) to UBOUND(array JREDisplay Name) ts. Write Line Now() & " - Uninstall String sent: " & array JREUninstall String(I) ret = wsh Shell. Write Line Now() & " - Return: " & ret If ret 3010 Then q Val = 1 Next Else If Cur Ver Found AND str Array Count = 0 Then ts.

'# Based on a script by 'muaddip' from message boards. Expand Environment Strings("%COMPUTERNAME%") If Not fso. Expand Environment Strings("%temp%") str Temp ISS = str Temp Dir & "\iss" str Un String = " -s -a /s /f1" Set ts In = fso. Write Line Now() & " - " & str Display Name & " - Version: " & str Display Version ts. Dim wsh Shell, fso, s Temp Set wsh Shell = Create Object("WScript. Open Text File(str Temp Dir & "\uninstall.tmp", 1) If Not fso. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & CLSID & "\Display Version") str Publisher = wsh Shell. Write Line "Name=Java 2 Runtime Environment, SE v1.4.0_01" ts ISS. Write Line Now() & " - No Old Java Runtime versions are installed." q Val = 99 Else If Not Cur Ver Found Then ts. Quit(1) End If End Sub Sub Kill Proc() '# kills and if they are running. Dim wsh Shell Set wsh Shell = Create Object("WScript. I am testing deploying it via SCCM/SMS and wanted to know if it's ok to change the exit code from 99 to something else. '# If the current version is not installed, it installs it from the specified path. '# Option Explicit Dim wsh Shell, fso, str Log File, ts, str Temp Dir, str Temp ISS, str Un String, ts In Dim str Uninst Line, CLSID, search5, search6, search7, str JRE1, str Display Name, str Display Version Dim str Publisher, str Uninstall String, str JREUninstall String, str JREDisplay Name Dim search1, search2, search3, search4, str JREUninstall String NEW, ret, str Uninst CMD Dim ts ISS, str Setupexe, q Val, str Computername, str Current Version, str Install MST Dim search Cur Ver, Cur Ver Found, str Array Count, str Log Path, str Install CMD, str Install MSI, str Install Log Dim array JREDisplay Name() Dim array JREUninstall String() '# Change this to match the version that you don't want to have it uninstall str Current Version = "Java(TM) 6 Update 13" '# Set these to the desired log path and current version installer location str Log Path = "\[Log Path]\_Logs\" str Install MSI = "\[Install Path]\jre1.6.0.13.msi" str Install MST = "\[Install Path]\jre1.6.0.13.mst" q Val = 0 str Array Count = 0 Re Dim array JREDisplay Name(str Array Count) Re Dim array JREUninstall String(str Array Count) Set wsh Shell = Create Object("WScript. Expand Environment Strings("%temp%") str Temp ISS = str Temp Dir & "\iss" str Un String = " -s -a /s /f1" Set ts In = fso. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & CLSID & "\Display Name") str Display Version = wsh Shell. Write Line Now() & " - Current version, " & str Current Version & ", found." ts. Run "Taskkill /F /IM /T", 0, True End Sub Might want to check the OS architecture and include the following reg path in the Pre Flight for 64bit systems: "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\Current Version\Uninstall". I'll need to look at my work computer and see how it's written.

I am sure that this modification could be prettier in the code, but this is the easiest. '# Based on a script by 'muaddip' from message boards. Expand Environment Strings("%COMPUTERNAME%") If Not fso. Expand Environment Strings("%temp%") str Temp ISS = str Temp Dir & "\iss" str Un String = " -s -a /s /f1" Set ts In = fso. Write Line Now() & " - " & str Display Name & " - Version: " & str Display Version ts. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\Current Version\Uninstall\" & CLSID & "\Display Name") str Display Version = wsh Shell. You have to remove the uninstall info for the other versions from the registry and reinstall them again to remove them properly.

'# Option Explicit Dim wsh Shell, fso, str Log File, ts, str Temp Dir, str Temp ISS, str Un String, ts In, bl Found Dim str Uninst Line, CLSID, search5, search6, search7, str JRE1, str Display Name, str Display Version Dim str Publisher, str Uninstall String, str JREUninstall String, str JREDisplay Name Dim search1, search2, search3, search4, str JREUninstall String NEW, ret, str Uninst CMD Dim ts ISS, str Setupexe, q Val, str Computername q Val = 0 Set wsh Shell = Create Object("WScript. Open Text File(str Temp Dir & "\uninstall.tmp", 1) If Not fso. Create Folder(str Temp ISS) bl Found = False Do While Not ts In. Read Line CLSID = Mid(str Uninst Line, 73, 38) search5 = Instr(str Uninst Line, "JRE 1") search6 = Instr(str Uninst Line, "]") If search5 0 Then str JRE1 = Replace(Mid(str Uninst Line, search5, search6),"]","") End If On Error Resume Next str Display Name = wsh Shell. Write Line Now() & " - Uninstall String sent: " & str Uninst CMD ret = wsh Shell. Write Line Now() & " - Return: " & ret If ret 3010 Then q Val = 1 End If Loop ts In. Open Text File(str Temp Dir & "\uninstall.tmp", 1) If Not fso. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\Current Version\Uninstall\" & CLSID & "\Display Version") str Publisher = wsh Shell. Write Line "Name=Java 2 Runtime Environment, SE v1.4.0_01" ts ISS. You might be able to get around this in the script by changing "Shared File=Yes To All" to "Shared File=No To All" in Create ISSFile but I haven't tested that yet. '*************************************************************************************** 'Java removal script. 'Description: Removes x86 and x64 Java runtimes, except for the specified version.

\.\root\default: Std Reg Prov")     'Set the logfile path here. Expand Environment Strings("%SYSTEMDRIVE%") & "\logs\"     'Find the Java uninstallers hiding in the uninstall key.Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & CLSID & "\Uninstall String") str JREUninstall String = wsh Shell. Write Line "Overwritten Read Only=No To All" ts ISS. Write Line "Dlg0=" & CLSID & "-Sprintf Box-0" ts ISS. Write Line "Dlg1=" & CLSID & "-File Transfer" ts ISS. Open Text File(str Temp ISS & "\" & CLSID & ".iss", 2, True) 'Create Response file for any Java Version ts ISS. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & str JRE1 & "\Display Name") On Error Goto 0 'Search for presence of Java and Sun in Display Name and Publisher search1 = Instr(1, str Display Name, "Java", 1) search2 = Instr(1, str Publisher, "Sun", 1) search3 = Instr(1, str Display Name, "J2SE", 1) search4 = Instr(1, str Uninstall String, "setup.exe", 1) search7 = In Str(1, str Display Name, "Development", 1) In Str(1, str Display Name, "Java DB", 1) 'See if it is the current version search Cur Ver = In Str(1, str Display Name, str Current Version, 1) 'If it is, Show that the current version is found If search Cur Ver "" Then '# JRE 1 found str JREUninstall String NEW = Replace(str JREUninstall String," -f"," -s -a /s /f") redim Preserve array JREDisplay Name(str Array Count) redim Preserve array JREUninstall String(str Array Count) array JREDisplay Name(str Array Count) = " - Found Old JRE: " & str Display Name & " - Version: " & str Display Version & ", Uninstalling..." array JREUninstall String(str Array Count) = str JREUninstall String NEW str Array Count = str Array Count 1 Else If search7 = 0 And search1 0 Then '# Old Install Shield setup found Set ts ISS = fso. Write Line Now() & " - No Old Java Runtime versions are installed." q Val = 99 End If End If ts. I'm writting a script to uninstall all versions of apache... what would be the value of "str JRE1" My system has 3 JRE versions... JRE 16 update 13 I'm getting no value in str JRE1... Write Line String(120,"_") & vb Cr Lf s Temp = wsh Shell. Run "REGEDIT /E %temp%\HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall", 0, True wsh Shell. Open Text File(str Temp Dir & "\uninstall.tmp", 1) If Not fso. Echo str Publisher int Comparision = Str Comp(str Publisher,"Apache Software Foundation") 'WScript.Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & str JRE1 & "\Uninstall String") str JREDisplay Name = wsh Shell. Open Text File(str Temp ISS & "\" & CLSID & ".iss", 2, True) 'Create Response file for any Java Version ts ISS. But i couldn't understand some part of your code... Here is the content of for java [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] "Display Icon"="C:\Program Files\Java\jre1.5.0_22\\bin\javaws.exe" "Authorized CDFPrefix"="" "Comments"="" "Contact"=" "Display Version"="1.5.0.220" "Help Link"=hex(2):68,00,74,00,74,00,70,00,3a,00,2f,00,2f,00,6a,00,61,00,76,00,\ 61,00,2e,00,63,00,6f,00,6d,00,00,00 "Help Telephone"="" "Install Date"="20100324" "Install Location"="" "Install Source"="C:\Program Files\Common Files\Java\Update\Base Images\jdk1.5.0.b64\patch-jdk1.5.0_22.b03\" "Modify Path"=hex(2):4d,00,73,00,69,00,45,00,78,00,65,00,63,00,2e,00,65,00,78,\ 00,65,00,20,00,2f,00,49,00,7b,00,33,00,32,00,34,00,38,00,46,00,30,00,41,00,\ 38,00,2d,00,36,00,38,00,31,00,33,00,2d,00,31,00,31,00,44,00,36,00,2d,00,41,\ 00,37,00,37,00,42,00,2d,00,30,00,30,00,42,00,30,00,44,00,30,00,31,00,35,00,\ 30,00,32,00,32,00,30,00,7d,00,00,00 "No Repair"=dword:00000001 "Publisher"="Sun Microsystems, Inc." "Readme"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\ 00,46,00,69,00,6c,00,65,00,73,00,5c,00,4a,00,61,00,76,00,61,00,5c,00,6a,00,\ 72,00,65,00,31,00,2e,00,35,00,2e,00,30,00,5f,00,32,00,32,00,5c,00,52,00,45,\ 00,41,00,44,00,4d,00,45,00,2e,00,74,00,78,00,74,00,00,00 "Size"="" "Estimated Size"=dword:00026a86 "Uninstall String"=hex(2):4d,00,73,00,69,00,45,00,78,00,65,00,63,00,2e,00,65,00,\ 78,00,65,00,20,00,2f,00,49,00,7b,00,33,00,32,00,34,00,38,00,46,00,30,00,41,\ 00,38,00,2d,00,36,00,38,00,31,00,33,00,2d,00,31,00,31,00,44,00,36,00,2d,00,\ 41,00,37,00,37,00,42,00,2d,00,30,00,30,00,42,00,30,00,44,00,30,00,31,00,35,\ 00,30,00,32,00,32,00,30,00,7d,00,00,00 "URLInfo About"=" "URLUpdate Info"=" "Version Major"=dword:00000001 "Version Minor"=dword:00000005 "Windows Installer"=dword:00000001 "Version"=dword:01050000 "Language"=dword:00000000 "Display Name"="J2SE Runtime Environment 5.0 Update 22" [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PRJPRO_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PRJPRO_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PRJPRO_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PRJPRO_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PRJPRO_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PRJPRO_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\_PROPLUS_] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] [HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall\] If Not fso. What are u trying to get at this part s JREUninstall String = wsh Shell. Run "cmd /c type %temp%\| find /i ""]"" %temp%\", 0, True If Not fso. Write Line Now() & " - No input - %temp%\Reg extract not created." ts. Echo displaycompare If int Comparision = 0 Then WScript. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & CLSID & "\Display Name") displaycompare = Instr(1,str Display Name,"Apache HTTP Server") If displaycompare 0 Then str Apache Uninstall String= wsh Shell.echo.************************************************************************ echo.************************************************************************ wmic product where "name like 'Java(TM) 6%%'" call uninstall wmic product where "name like 'Java 7%%'" call uninstall goto END : END Works both on XP and Winds 7 The trick on Windows 7 is to run it as Administrator (or to run wmic in Administrator Command Prompt -- wherever comes first)In the interest of sharing, below is pasted my Sun Java uninstall all script, originally based on the one above by muaddip. Write Line Now() & " - Java Runtime(s) uninstallation" ts. Quit(1) End If End Sub Sub Kill Proc() '# kills and if they are running. Dim wsh Shell Set wsh Shell = Create Object("WScript. Reg Read("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Current Version\Uninstall\" & str JRE1 & "\Display Name") On Error Goto 0 'Search for presence of Java and Sun in Display Name and Publisher search1 = Instr(1, str Display Name, "Java", 1) search2 = Instr(1, str Publisher, "Sun", 1) search3 = Instr(1, str Display Name, "J2SE", 1) search4 = Instr(1, str Uninstall String, "setup.exe", 1) search7 = In Str(1, str Display Name, "Development", 1) In Str(1, str Display Name, "Java DB", 1) 'Make sure it is not the current version search Cur Ver = In Str(1, str Display Name, str Current Version, 1) If search Cur Ver "" Then bl Found = True '# JRE 1 found str JREUninstall String NEW = Replace(str JREUninstall String," -f"," -s -a /s /f") ts. Write Line Now() & " - Uninstall String sent: " & str JREUninstall String NEW ret = wsh Shell. Write Line Now() & " - Return: " & ret If ret 0 Then '# Old Install Shield setup found Set ts ISS = fso. But if the msiexec process fails to uninstall one of the versions because the process is still running, the msiexec return code will be logged in the log. I agree completely with your critique, however I believe that the effort you put into error-trapping has to be proportionate to the chances of an error occurring undetected. Simple solutions always appeal to me :o) I only found the technique via the MS forums though (searched for: "bugassert" site:on google) but I like the idea. Write Line String(120, "_") & vb Crlf '# Generate Registry extracts from 'Uninstall' keys. Close Dim I If Cur Ver Found AND str Array Count 0 Then ts. Hi Jean, Yes you can just change that line to determine the exit code for if the script did not find any Sun JRE versions to uninstall. Write Line Now() & " - Java Runtime(s) uninstallation started..." ts. Close str Setupexe = Left(str Uninstall String, search4 9) str Uninst CMD = str Setupexe & str Un String & Chr(34) & str Temp ISS & "\" & CLSID & ".iss" & Chr(34) End If redim Preserve array JREDisplay Name(str Array Count) redim Preserve array JREUninstall String(str Array Count) array JREDisplay Name(str Array Count) = " - Found Old JRE: " & str Display Name & " - Version: " & str Display Version & ", Uninstalling..." array JREUninstall String(str Array Count) = str Uninst CMD str Array Count = str Array Count 1 End If Loop ts In.I have tightened it up a bit and it now fully logs to "C:\Logs\Java_Uninstall_%COMPUTERNAME%". The script does not rely on any batch files as it performs the same function from within the Pre Flight() sub in the script. The script will exit with return codes: 99 if no Sun JRE versions were found to uninstall. Write Line String(80, "_") & vb Crlf '# Generate Registry extracts from 'Uninstall' keys. Delete File(str Temp Dir & "\uninstall.tmp") WScript. Run "REGEDIT /E %temp%\HKEY_LOCAL_MACHINE\SOFTWARE\microsoft\windows\currentversion\uninstall", 0, True wsh Shell. Open Text File(str Temp ISS & "\" & CLSID & ".iss", 2, True) 'Create Response file for any Java Version ts ISS. In my case (and I only wrote the script for my situation, sharing was a courtesy), it was virtually impossible for the script to fail and me not know about it. Daz, point taken but a) check out some of the MS scripts which feature a routine called Bug Assert. Used once, you'll never trot out that excuse again. Cheers, Daz.'# Galen Dobbs - 23/03/2009 '# Uninstalls all but the chosen version of Java Runtime. Expand Environment Strings("%COMPUTERNAME%") '# Set this to the appropriate command line settings to do a silent MSI install str Install Log = str Log Path & "Java_Install_" & str Computername & ".log" str Install CMD = "msiexec /I """ & str Install MSI & """ /t """ & str Install MST & """ /QN /Lime """ & str Install Log & """" If Not fso. Create Folder(str Log Path) str Log File = str Log Path & "Java_Uninstall_" & str Computername & ".log" Set ts = fso. Pre Flight() '# Kill Java Processes Kill Proc() str Temp Dir = wsh Shell. Read Line CLSID = Mid(str Uninst Line, 73, 38) search5 = Instr(str Uninst Line, "JRE 1") search6 = Instr(str Uninst Line, "]") If search5 0 Then str JRE1 = Replace(Mid(str Uninst Line, search5, search6),"]","") End If On Error Resume Next str Display Name = wsh Shell. Writeline Now() & " - Current Version: " & str Current Version & " found, continuing with uninstalls..." For I = LBOUND(array JREDisplay Name) to UBOUND(array JREDisplay Name) ts. Write Line Now() & " - Uninstall String sent: " & array JREUninstall String(I) ret = wsh Shell. Write Line Now() & " - Return: " & ret If ret 3010 Then q Val = 1 Next Else If Cur Ver Found AND str Array Count = 0 Then ts. I always use 99 in my scripts to mean 'Job not required or already run'. Jean, Please note that Galen Dobbs' later version of my script sets q Val to 99 in more than one place. Write Line String(120, "_") & vb Crlf '# Generate Registry extracts from 'Uninstall' keys. Close Dim I If Cur Ver Found AND str Array Count 0 Then ts.

Leave a Reply