Start a new process and Killing the current process

后端 未结 5 1393
无人共我
无人共我 2020-12-31 04:15

I want to start a new process B.exe from the current executing process A.exe.

And as soon as B.exe is launched I want to kill A.exe (the current executing process).<

5条回答
  •  感动是毒
    2020-12-31 04:41

    Why do you want to close A from B while A cat start B and then close by itself?

    Process.Start("A.exe");
    Process.GetCurrentProcess().Kill(); // or Application.Exit(); or anything else
    

提交回复
热议问题