This is my first script using AutoIt and I am trying to pull as much Startup data as I can. The problem I am having when I run the script below is that the first couple of entries for $StartData[$LoopNum][0] are empty but the later ones contain the data. I'm using version 3.1.1.55. Can someone take a look at this and help me figure out where I'm going wrong?
Script:
#include <Array.au3>
#cs
$StartData [x][0] = Name in Registry
$StartData [x][1] = Name in Registry Value
$StartData [x][2] = File Name
$StartData [x][3] = File Path without flags
$StartData [x][4] = File Version
$StartData [x][5] = Description <-- Figure This Out Later
$StartData [x][6] = Copyright <-- Figure This Out Later
$StartData [x][7] = Registry Path
#ce
$ProcessTotal = ProcessList()
$RunLoop = $ProcessTotal[0][0]
Dim $StartData[ ($ProcessTotal[0][0]) ][8]
Dim $Var, $RegVar[7]
$RegVar[0] = ""
$RegVar[1] = "HKLM\Software\Microsoft\Windows\CurrentVersion\Run"
$RegVar[2] = "HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce"
$RegVar[3] = "HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices"
$RegVar[4] = "HKCU\Software\Microsoft\Windows\CurrentVersion\Run"
$RegVar[5] = "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce"
$LastLoop = 0
$PathLoop = 0
For $PathLoop = 1 To 5
$RegPath = $RegVar[$PathLoop]
$LoopNum = 0
Do
$LoopNum = $LoopNum + 1
$StartData[$LoopNum][0] = RegEnumVal($RegPath, $LoopNum)
If $StartData[$LoopNum][0] = "" Then
$LoopNum = $RunLoop
Else
$StartData[$LoopNum][1] = RegRead($RegPath, $StartData[$LoopNum][0])
$len = StringLen($StartData[$LoopNum][1])
$baby = ""
$BSTest = ""
$STest = ""
$RFTest = ""
For $BSTest = $len To 1 Step - 1
$yeah = StringMid($StartData[$LoopNum][1], $BSTest, 1)
If $BSTest = 1 Then $baby = $StartData[$LoopNum][1]
If $yeah = "\" Then
$baby = StringMid($StartData[$LoopNum][1], ($BSTest + 1))
$FirstBaby = StringMid($StartData[$LoopNum][1], 1, $BSTest)
$BSTest = 1
EndIf
Next
If StringRight($baby, 1) = '"' Then $baby = StringTrimRight($baby, 1)
For $STest = $len To 1 Step - 1
$yeah2 = StringMid($baby, $STest, 1)
If $STest = 1 Then $StartData[$LoopNum][2] = $baby
If $yeah2 = " " Then
$StartData[$LoopNum][2] = StringMid($baby, 1, ($STest - 1))
$STest = 1
EndIf
Next
If StringRight($StartData[$LoopNum][2], 1) = '"' Then $StartData[$LoopNum][2] = StringTrimRight($StartData[$LoopNum][2], 1)
$StartData[$LoopNum][3] = $FirstBaby & $StartData[$LoopNum][2]
If StringLeft($StartData[$LoopNum][3], 1) = '"' Then $StartData[$LoopNum][3] = StringTrimLeft($StartData[$LoopNum][3], 1)
$StartData[$LoopNum][4] = "FileVersion: " & FileGetVersion($StartData[$LoopNum][3])
$StartData[$LoopNum][5] = "Description: "
$StartData[$LoopNum][6] = "Copyright: "
$StartData[$LoopNum][7] = $RegPath
$LastLoop = $LastLoop +1
EndIf
Until $LoopNum = $RunLoop
Next
$PathLoop = 0
$LoopRun = 0
$Var = ""
For $LoopRun = 1 To ($LastLoop - 1)
; MsgBox(0, "Test", $Var)
$Var = $Var & $StartData[$LoopRun][0] & ", " & $StartData[$LoopRun][1] & ", " & $StartData[$LoopRun][2] & ", " & $StartData[$LoopRun][3] & @CRLF & $StartData[$LoopRun][4] & ", " & $StartData[$LoopRun][5] & ", " & $StartData[$LoopRun][6] & ", " & $StartData[$LoopRun][7] & @CRLF & @CRLF
Next
MsgBox(0, "Startup", $Var)