Redirect standardoutput for Microsoft hotfix
<p>im currently trying to write a dll that handles the intall of MS hotfixes via a vbscript. I have so far managed to get the core functionality working and have managed to trap the return codes but would like to go one step further - I need to trap the output from the process as the return codes are not always correct (ie. if a hotfix is not required it still returns a return code of 0 - not good).</p>

<p>Below is a copy of some of the code im using to start the process and write the output to the event log but it write a blank values all the time...any ideas what im doing wrong?</p>

<pre><code>   Process p = new Process();

            p.StartInfo.FileName = strExe;
            p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.UseShellExecute = false;

            p.Start();
            string output = p.StandardOutput.ReadToEnd();
            p.WaitForExit();

            WriteEvent(strAppName, "Error", 1000, output);
</code></pre>
