#include <array.au3>
Global $Def_User_Run = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
Global $User_Run = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run'
Global $User_Run_Once = 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce'
Global $Machine_Run_Once = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce'
Global $Machine_Run_OnceEx = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx'
Dim $aPath[5] = [$Def_User_Run, $User_Run, $User_Run_Once, $Machine_Run_Once, $Machine_Run_OnceEx]
Dim $array[30][2]
Global $row = 1, $i = 0, $key = 1
For $i = 0 To 4
While 1
$array[$row][0] = RegEnumVal($aPath[$i], $key)
if @error <> 0 Then ExitLoop
$array[$row][1] = RegRead($aPath[$i], $array[$row][0])
$row += 1
$key += 1
WEnd
$key = 1
Next
$array[0][0] = $row - 1
ReDim $array[$row][2]
_ArrayDisplay($array)