Failing to redirect stdout or stderr of an executable in windows
<p>I'm trying to redirect the output of a windows exe file that I received from a vendor.  I don't have the code to this file and the vendor is a little hawkish, so sorry for the obfuscation.</p>

<p>Please not that I'm not trying to concatenate output and error together - I can't get either to redirect.</p>

<p>If I run it using powershell, I get the following</p>

<pre><code>PS C:\test&gt;.\vendor.exe
output
output
output
error
error
output
</code></pre>

<p>When I try to redirect stdout, I get the following.</p>

<pre><code>PS C:\test&gt;.\vendor.exe &gt; output.txt
error
error
</code></pre>

<p>However whilst output.txt is created, it is an empty file.  It appears of length 0.</p>

<p>Any ideas how to achieve the redirection, or if it is possible to prevent redirection in an exe?</p>