#include <MsgBoxConstants.au3>

Local $sSubKey = ""
For $i = 1 To 10
    $sSubKey = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks", $i)
    If @error Then
		MsgBox($MB_SYSTEMMODAL, "SubKey #" & $i , "Fehler")
        ExitLoop
    EndIf
    MsgBox($MB_SYSTEMMODAL, "SubKey #" & $i , $sSubKey)
Next
