Jump to content

Recommended Posts

Posted

I posted before about dumping event log, now my boss wants me to do something different so i have to start over. Anyway haha.....havent programed in a while let alone with autoit. How can i get this to show up in the list view

Func _GetLog()
    Dim $line
    Dim $eType
    Dim $eEvent
    Dim $Array[5]
    Dim $x
    
    $foo = Run(@ComSpec & " /c " & @SystemDir & "\CSCRIPT.EXE  EVENTQUERY.VBS /L System /R 20 /FO CSV //Nologo >> c:\sys.txt", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    Sleep(400)
    If Not _FileReadToArray("c:\sys.txt", $line) Then
        MsgBox(4096, "Error", " Error reading file to Array - error:" & @error)
        Exit
    EndIf
    ;5$line = StringStripWs($line, 8)
    For $x = 1 To $line[0]
        $Array = StringSplit($line[$x], ",")
        _ArrayDisplay($Array,"")
        ;$eType = $line[1]
        ;msgbox(0,"",$eType)
        ;$eEvent = $line[2]
        ;MsgBox(0,"",$eEvent)
        ;$eTest = $line[$x]
        ;MsgBox(0,"",$eTest)
        GUICtrlCreateListViewItem($Array[1] & " | " &  "" &  " | " & "" & " | " & "" & " | " & "" & " | ", $lstViewGrid)
        ;MsgBox(0,"", $eType)
        ;MsgBOx(0,"", $eEvent)
    Next
    
    ;If FileExists("c:\sys.txt") Then
    ;   $Open = FileOpen("c:\sys.txt",0)
    ;   $Read = FileRead($Open)
    ;   $file = StringStripWS(StringTrimLeft($Read, 220), 8)
    ;   $new = StringSplit($file, ",")
    ;   MsgBox(0,"",$new[1])
    ;   Msgbox(0,"",$new[2])
        ;MsgBox(0,"",$file)
    ;EndIf
EndFunc

i have alot commented out for debugging crap, i know its a mess but im at a loss for the moment. Any help is appreciated

-zimy

Posted

why have the arraydisplay in there just curios and if you want to add somethign to the listview change the [1] to [$x]

did the array display so i could make sure that its grabbing at least some info and stuffin it into an array.

I did change the [1] to [$x] gave me an error about the subscript and would put the data into the list view

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...