I think you want to use a function that recurses itself.
First time trying to write something like that. I hope it works as it should.
;*************************************************************************
;  Script Name:   EnumKeyAll
;  Author:        Wim Rotty
;  Date:          7/10/2007
;  Description:   Recursive function to list all subkeys
;*************************************************************************

 
;Script Options
If Not @LOGONMODE
   Break On
Else
   Break Off
EndIf
Dim $RC
$RC = SetOption("Explicit", "On")
$RC = SetOption("NoMacrosInStrings", "On")
$RC = SetOption("NoVarsInStrings", "On")
If @SCRIPTEXE = "KIX32.EXE"
   $RC = SetOption("WrapAtEOL", "On")
EndIf

;Declare variables
Dim
 
$Key

;Initialize variables
$Key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion";\Uninstall";\Installshield Uninstall Information"

;Code
???

For Each $RC in EnumKeyAll($Key)
   
$RC ?
Next
Get $RC

;Personal UDF Section
Function
 EnumKeyAll($Key)
   
Dim $i, $strKey, $arrKeys[0]
   
ReDim Preserve $EnumKeyAll[0]
   
$i = 0
   
$strKey = EnumKey($Key,$i)
   
While Not @ERROR
        $strKey = $Key+"\"+$strKey
        ;$strKey ?
        If Not $EnumKeyAll[0] = ""
            ReDim Preserve $EnumKeyAll[UBound($EnumKeyAll)+1]
       
EndIf
        $EnumKeyAll[UBound($EnumKeyAll)] = $strKey
        $i = $i + 1
       
$strKey = EnumKey($Key,$i)
   
Loop
    If Not $EnumKeyAll[0] = ""
        For Each $strKey in $EnumKeyAll
            ;$strKey ?
            $ArrKeys = EnumKeyAll($strKey)
           
If Not $arrKeys[0] = ""
                For Each $strKey in $arrKeys
                    ReDim Preserve $EnumKeyAll[UBound($EnumKeyAll)+1]
                   
$EnumKeyAll[UBound($EnumKeyAll)] = $strKey
                Next
            EndIf
        Next
    EndIf
EndFunction

;UDF Section