I wrote the following two functions, and call the second (\"callAndWait\") from JavaScript running inside Windows Script Host. My overall intent is to call one command line
Yes, the Exec function seems to be broken when it comes to terminal output.
I have been using a similar function function ConsumeStd(e) {WScript.StdOut.Write(e.StdOut.ReadAll());WScript.StdErr.Write(e.StdErr.ReadAll());}
that I call in a loop similar to yours. Not sure if checking for EOF and reading line by line is better or worse.