title: How to get Output of a Command Prompt Window line by line in Visual Basic?
body: <p>I am trying to get a command line output line by line till the end of the output but I am not able to do so. I am using it in my Form and this code executes on click of a button. <br>
  Can you tell me whats wrong with my code?</p>
  
  <pre><code>Dim proc As ProcessStartInfo = New ProcessStartInfo("cmd.exe")
      Dim pr As Process
      proc.CreateNoWindow = True
      proc.UseShellExecute = False
      proc.RedirectStandardInput = True
      proc.RedirectStandardOutput = True
      pr = Process.Start(proc)
      pr.StandardInput.WriteLine("cd C:\sdk\platform-tools\")
      pr.StandardInput.WriteLine("adb help")
      Dim helpArray(20) as String
      For i as Integer 1 To 7
      helpArray(i) = pr.StandardOutput.ReadLine()
      Next
      pr.StandardOutput.Close()
  </code></pre>
  
  <p>The program stops responding when this code is executed.</p>