Jump to content

Brona

Members
  • Posts

    5
  • Joined

  • Last visited

Brona's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. That last ; I put in just in case you did not want to delete the 'SearchResults.txt' file when you are done ... I did on mine as not to leave any files behind when done running the script.
  2. Check out topic: http://www.autoitscript.com/forum/index.php?showtopic=13437
  3. I added the following to the script and it appears to work: $file = FileOpen($resultFile, 0) While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop FileDelete($line) Wend FileClose($file) ;FileDelete($resultFile)
  4. My goal for the script is to find all the data loading in the Run, RunOnce, etc. registry keys and load it into an array. Once I can accomplish this, I figured I would write in some functions to manipulate that data. I used the ProcessList() function to get a max limit for the array. When I run the script, it finds all 9 items I have in those keys, it's just those first few keys have the name missing, as you pointed out. Why it is working only a portion of the time is what confuses me. With this being my first script, what I'm trying to figure out is why the name is missing and how to correct it. I've looked all through the help file and don't seem to be coming up with the solution. Any assistance you can provide in accomplishing this with AutoIt would be greatly appreciated.
  5. 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)
×
×
  • Create New...