Jump to content

StdoutRead Problem


thl1000
 Share

Recommended Posts

Hi,

i have some probs with this part of code:

#
$a = Run(@ComSpec & " /c H:\Tools\psexec.exe \\server02 test.cmd", "", @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD)
While 1
    $b = StdoutRead($a)
    If @error Then ExitLoop
    MsgBox(0, "STDOUT read:", $b)
Wend

This code works fine if i call it standalone

Calling it within a function (see code below), the while...wend part seems not to be executed...

Func _VMACHINES()
        LOCAL $H = GUICtrlRead($HServer_List)
        LOCAL $a
        LOCAL $b

        If $H = "--------" Then
              MsgBox(0, "Fehler", "Bitte wählen Sie einen Host-Server aus!")
        EndIf
      
        $a= Run(@ComSpec & " /c H:\Tools\psexec.exe \\server02 test.cmd", "", @SW_SHOW, $STDOUT_CHILD)
        While 1
            $b= StdoutRead($a)
            If @error Then ExitLoop
            GUICtrlSetData($V_List, $b, "--------")
           ;MsgBox(0, "STDOUT read:", $b)
        Wend

        GUICtrlSetState($VM_List,$GUI_ENABLE)
        GUICtrlSetState($BackUp, $GUI_ENABLE)
EndFunc

Does anybody has an idea how to get it working??

Link to comment
Share on other sites

Calling it within a function (see code below), the while...wend part seems not to be executed...

how did you check if the while...wend part gets executed?

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

I checked it using the message box

is the code posted above the FULL source code?

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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...