It appears that you trying to re-invent several wheels with redirecting output from processes, and the question is why ?
Back-ticks work just fine in capturing console output, and do not pop up a console window.
In reply to Re: How do I pipe a Win32::API Process to a handle?
by NetWallah
in thread How do I pipe a Win32::API Process to a handle?
by slloyd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |