in reply to Re^2: WIN redirecting STDOUT and STDIN to new spawned CMD console
in thread WIN redirecting STDOUT and STDIN to new spawned CMD console

> would be a very roundabout fashion

Well with variations it's just a classic.

You start a second console running the application redirecting STDERR to a log file. The first console does a tail -f on the log-file

With PowerShell in the first window at least that's technically feasible, it has a tail like mechanism. °

> Perhaps better with a named pipe

Not sure how hard it is to have named pipes on windows.

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

updates

°) Get-Content -Path ".\err.log" -Wait

Replies are listed 'Best First'.
Re^4: WIN redirecting STDOUT and STDIN to new spawned CMD console
by soonix (Chancellor) on Mar 29, 2023 at 08:19 UTC

      Also, https://rkeithhill.wordpress.com/2014/11/01/windows-powershell-and-named-pipes/ one of many links showing how to create them pipes in powershell. Oh you need to ignite the pipe server! I can't believe it's not butter lol. And lol2 reading the comments under SO links provided above, like: A|B|C is possible but it waits A to finish in order to "pipe" its output into B and ditto on to C. I stop here lest this becomes trolling.

      Q: can IPC::Run be used to create windows pipes? LIMITATIONS section says it's experimental.