C#C
C#3y ago
Mek

✅ Closing first terminal, opening second terminal

// in file A
var p = new Process();
p.StartInfo.FileName = "test.exe";
p.Start();

// in file B
var p = new Process();
p.StartInfo.FileName = "main_app.exe";
p.Start();

My main program in
main_app.exe
. When I run my main program, it opens in terminal 1 as expected. When
main_app.exe
runs the new process to start a second program, I would like for that second program to open in a new terminal (terminal 2) and the terminal (terminal 1) to be closed. So close current terminal, open new terminal. Then when the second program finishes it's process and relaunches
main_app.exe
, I would like for terminal 2 to close, and a new terminal (terminal 3) to open. How would I accomplish this?

TL:DR
  1. main_app.exe
    => terminal 1
  2. test.exe
    => terminal 2
  3. terminal 1 finishes work, opens terminal 2, closes terminal 1
  4. terminal 2 finishes work, opens terminal 3, closes terminal 2
Was this page helpful?