Jump to content

My problem...


electrico
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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