I tried this code:
Local $foo = Run(@ComSpec & " /c dir", '', 0, 2)
Local $line
While 1
$line = StdoutRead($foo)
If @error Then ExitLoop
$line = StringStripCR($line)
If StringLen($line) > 0 Then ConsoleWrite("START" & $line & "END" & @CRLF)
WEnd
I expected to get one line at a time, but instead I get 2, 3 or 50 lines. Why does this happen?