Sign in to follow this  
Followers 0
electrico

My problem...

9 posts in this topic

#1 ·  Posted (edited)

Look, here is my problem, guys. Here is code, where processlist is captured from remote host, and string 'processL.exe' is searched in logfie that stored in @TempDir, with consequent msgboxes and functions..

If Not _FileReadToArray(@TempDir & '\' & GuiCtrlRead($ipadress) & ".log", $aRecords) Then
    MsgBox(48, "Cannot capture process list", "Either host is isolated from your network or RPC service is not running on remote host")
For $x = 1 to $aRecords[0]
    If StringInStr ($arecords [$x], "processL.exe") Then Msgbox (64, "+", "ProcessL is running on remote host.")
Next
    Else
    $askinjection = MsgBox(52, "-", "Probably, the ProcessL is not running on remote host." & @CRLF & "Install it?")
    If $askinjection = 6 Then
        injectradmin()
    Else
        MsgBox(48, "", "You refused.")
    EndIf
    If Not IsArray($askinjection) Then Return SetError(1, 0, 0)
EndIf

Please help me.. With that code I never get the positive MsgBox, that notify me about existence of "processL.exe" on remote host, always got negative... Any ideas how to correct it?

Edited by electrico

Share this post


Link to post
Share on other sites



Have you tried displaying what is captured from your log file to see if the information is really there?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Sorry for spamming here - just glad to see how much guys are looking through this post.. Melba thank you for advance, :mellow: .. Please concentrate in how do i get this message "If StringInStr ($arecords [$x], "ProcessL.exe") Then Msgbox (64, "+", "ProcessL is running on remote host.")" when process is found in logfile..

Be sure, every var is declared ... this is just little piece of code where I stucked.

Thanks.

Edited by electrico

Share this post


Link to post
Share on other sites

electrico,

I think your logic flow was a bit off. Take a look at this: :mellow:

If Not _FileReadToArray(@TempDir & '\' & GUICtrlRead($ipadress) & ".log", $aRecords) Then

    ; File not read
    GUICtrlDelete($captureprogress2)
    MsgBox(48, "Cannot capture process list", "Either host is isolated from your network or RPC service is not running on remote host")
    
    ; What do want to do now? Exit?
    
Else
    
    ; File was read so check if our process is there
    For $x = 1 To $aRecords[0]
        If StringInStr($aRecords[$x], "processL.exe") Then
            ; Found it
            MsgBox(64, "+", "ProcessL is running on remote host.")
            ExitLoop
        EndIf
    Next
    ; We get here if the process was found or not
    GUICtrlDelete($captureprogress2)
    
    ; Check if we ran out of the For...Next loop because the process was NOT found
    If $x > $aRecords[0] Then 
        $askinjection = MsgBox(52, "-", "Probably, the ProcessL is not running on remote host." & @CRLF & "Install it?")
        If $askinjection = 6 Then
            injectradmin()
        Else
            MsgBox(48, "", "You refused.")
            Return SetError(1, 0, 0)
        EndIf
    EndIf
    
    ; if we get here either teh process was found above, or we have just installed it

EndIf

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

wraithdu, as I am not strong in AutoIt yet, I would request example if it is possible.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Just print out what is captured by _FileListToArray (you'll have to run this from Scite to see the console ouput):

For $x = 1 to $aRecords[0]
     ConsoleWrite($aRecords[$x] & @CRLF)
     ...
Edited by wraithdu

Share this post


Link to post
Share on other sites

Melba thank you very much. I know it costs nothing for you but you helped me to save my project. Thanks.

Wraithdu thanks for paying attention.

Share this post


Link to post
Share on other sites

Heh, I see it now. Plain code tags really mess with posted scripts.

Share this post


Link to post
Share on other sites

wraithdu,

Or the OP not using Tidy before posting! :(

I cannot believe the state of some of the code posted on the forum. How anyone expects to be able to follow their own code when it is as haphazardly structured and indented as some of the examples you see here is beyond me. :mellow:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0