Is there a reason you are using the | character in your command? Are you trying to do something else, that you haven't mentioned, that is also not producing the expected output to the RichTextBox?

I ask since changing your command to something like
Code:
proc.StandardInput.WriteLine("cdf")
will produce error text in the RichTextBox as expected.

I never got around to using DOS, so I don't have an answer as to why it's not working with "cd|". However, I believe the | character is the DOS Pipe operator. Could it be that you can't use piping while you are also redirecting standard output/error streams? As an observation, when issuing a command such as
Code:
proc.StandardInput.WriteLine("dir C:\Windows\System32 | MORE")
the | MORE seems to be ignored.


On a related note, should you want to display the output from the STDOUT and STDERR streams "simultaneously" (as opposed to any error messages all being tagged on to the very end of your RichTextBox's Text), then you could use the DOS redirect 2>&1 after your command. This would redirect STDERR to STDOUT before STDOUT is redirected to your RichTextBox. I'm sorry to say that it doesn't help with your original problem, though.
vb.net Code:
  1. Dim start_info As New ProcessStartInfo("cmd.exe")
  2. start_info.UseShellExecute = False
  3. start_info.CreateNoWindow = True
  4. start_info.RedirectStandardOutput = True
  5. ' start_info.RedirectStandardError = True
  6. start_info.RedirectStandardInput = True
  7.  
  8. Dim proc As New Process()
  9. proc.StartInfo = start_info
  10. proc.Start()
  11.  
  12. proc.StandardInput.WriteLine("cdf 2>&1")
  13. proc.StandardInput.Close()
  14.  
  15. Dim std_out As StreamReader = proc.StandardOutput()
  16. '  Dim std_err As StreamReader = proc.StandardError()
  17.  
  18. RichTextBox1.Text = std_out.ReadToEnd() ' + std_err.ReadToEnd()
  19.  
  20. std_out.Close()
  21. ' std_err.Close()
  22.  
  23. proc.Close()

You don't need to comment out (remove) the StandardError lines, but it might make more sense to do so.