'jxProjectOldRegInstalltions.vbs 'Identifies old jxProject installations that need removal ' 'Peter Hawkins ' ' HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\jxProject 2.5.0.2\InstallLocation ' ' On Error Resume Next Dim versionArray, version versionArray = Array("2.5.0.2", "2.4.1.2", "2.4.0.2", "2.3.0.2", "2.2.1.2", "2.2.0.2") 'For Each version In versionArray ' Wscript.Echo version 'Next 'Wscript.QUIT 'installLocationKey="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\jxProject 2.5.0.2\InstallLocation" Dim keyFirst, keyLast keyFirst="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\jxProject " keyLast="\InstallLocation" Dim checkCount, foundCount Dim Sh, installLocation Set Sh = WScript.CreateObject("WScript.Shell") set checkCount=0 set foundCount=0 For Each version In versionArray installLocationKey=keyFirst+version+keyLast ' MsgBox "installLocationKey is: " + installLocationKey Err.Clear installLocation=Sh.RegRead (installLocationKey) ' MsgBox "installLocation: " + installLocation checkCount=checkCount+1 If Err.Number=0 Then foundCount=foundCount+1 MsgBox "Found Old installation in registry for jxProject version: " & version & vbCrLf & "You need to manually delete files located at: " + installLocation End If Next Err.Clear 'MsgBox "Hello: " & foundCount If foundCount>0 Then MsgBox "End script; found: " & foundCount & " installation(s)" Else MsgBox "End script; No old jxProject installations found in windows registry" End If