title: Pick up strings from cmd command? Process.StartInfo
body: <p>so I've tried Process and starting a cmd.exe and send commands directly to that window. And then picking up the values written to the cmd.exe window. </p>
  
  <p>The code looks like this:</p>
  
  <pre><code>Dim arrServers As ArrayList
      Dim s(ListBoxServers.Items.Count) As String
  
      ListBoxServers.Items.CopyTo(s, 0)
      arrServers = New ArrayList(s)
  
      Using P As New Process
          P.StartInfo.FileName = "cmd.exe"
          P.StartInfo.UseShellExecute = False
          P.StartInfo.RedirectStandardOutput = True
          P.StartInfo.RedirectStandardInput = True
          P.Start()
          For Each i In arrServers
              P.StandardInput.WriteLine("query user " &amp; txtBoxUsername.Text &amp; " /server:" &amp; i)
          Next
          P.StandardInput.WriteLine("exit")
          Output = P.StandardOutput.ReadToEnd()
          Trace.WriteLine(Output)
          MsgBox(Output)
          P.WaitForExit()
  
      End Using
  </code></pre>
  
  <p>But is looks like it doesn't "press enter" or something. Meaning, I don't get any results from the command. I don't even get a "'command' is not recognized as an internal or external command, operable program or batch file." like you normally get if it doesn't understand the syntax. </p>