electrico Posted February 24, 2010 Posted February 24, 2010 (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 February 24, 2010 by electrico
wraithdu Posted February 24, 2010 Posted February 24, 2010 Have you tried displaying what is captured from your log file to see if the information is really there?
electrico Posted February 24, 2010 Author Posted February 24, 2010 (edited) Sorry for spamming here - just glad to see how much guys are looking through this post.. Melba thank you for advance, .. 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 February 24, 2010 by electrico
Moderators Melba23 Posted February 24, 2010 Moderators Posted February 24, 2010 electrico, I think your logic flow was a bit off. Take a look at this: 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
electrico Posted February 24, 2010 Author Posted February 24, 2010 wraithdu, as I am not strong in AutoIt yet, I would request example if it is possible.
wraithdu Posted February 24, 2010 Posted February 24, 2010 (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 February 24, 2010 by wraithdu
electrico Posted February 24, 2010 Author Posted February 24, 2010 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.
wraithdu Posted February 24, 2010 Posted February 24, 2010 Heh, I see it now. Plain code tags really mess with posted scripts.
Moderators Melba23 Posted February 24, 2010 Moderators Posted February 24, 2010 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. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now