Suppose I start a Process for running a console application like 7z.exe (7-Zip Archiver). I am creating the Process without a window and I'm redirecting the standard output.
I want to know how to stop the Process other than "Process.Kill", because that causes an incomplete/corrupt archive file to be left behind.
If I press CTRL-BREAK when running 7z.exe from a normal command console window, it shuts down gracefully and deletes the incomplete file.
If cmd.exe can start a process and send it a ctrl-break signal, then how can my own application start a process and send it a ctrl-break (or equivalent) signal, so that the process shuts down gracefully?