Hi im would like to make a gui for a console program i use. I am able to start the cmd.exe and change to the directory the program is in. My problem is after i issue a command to the console such as cd c:\myconsoleapp cmd.exe closes why is this. I would like the console to stay running so i can issure more commands to it without having to re declare streamwriter and reader and starting the process each time.
Code:
  myProcess.startInfo.CreateNoWindow = false
     myProcess.StartInfo.FileName = "cmd.exe"      
     myProcess.StartInfo.UseShellExecute = false
     myProcess.StartInfo.RedirectStandardInput = True
     myProcess.StartInfo.RedirectStandardOutput = True      
     myProcess.Start()
   

        Dim myStreamWriter As system.IO.StreamWriter = myProcess.StandardInput

        Dim mystreamreader As system.IO.StreamReader = myProcess.StandardOutput

       myStreamWriter.WriteLine("cd C:\myconsoleapp")
      
                 myStreamWriter.Close()
 
       Dim str As String = mystreamreader.ReadToEnd
          
          //display console text in textbox        
          shelltb.Text = shelltb.Text & vbcrlf & str