Jump to content

Recommended Posts

Posted

I have some problem to get the Output in realtime. The consolen output is "Verbindung herstellen mit xxxxxx..." sleep for ~3 sec and then "Überprüfung des Benutzernamens und Kennworts" sleep for ~3 sec ....... but the ConsoleWrite and GUICtrlSetData(Editbox) show that when the process ends and the connection ist online. How can i get the output in realtime ?

Local $foo = Run(@ComSpec & ' /c rasdial.exe xxxxxx ' & GUICtrlRead($Username) & ' ' & GUICtrlRead($Password) & ' /phonebook:"' & @ScriptDir & '\vpn.inf"', @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    Local $line
    While 1
        $line = StdoutRead($foo)
        If @error Then ExitLoop
        if StringInStr ( $line, 'Verbindung mit "xxxxxx" wurde hergestellt.' ) Then
            $connection = 1
        EndIf
        ConsoleWrite($line)
        GUICtrlSetData($myedit, $line, 1)
    Wend
    StdioClose($foo)

Output:

Verbindung herstellen mit xxxxxx...
Überprüfung des Benutzernamens und Kennworts...
Der Computer wird im Netzwerk registriert...
Verbindung mit "xxxxxx" wurde hergestellt.
Der Befehl wurde erfolgreich ausgeführt.

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
×
×
  • Create New...