Wait, are you trying to close your own process, or close a process from a different one?
To close the process thats running that code:
Code:
Environment.Exit(Environment.ExitCode);
Else you need to do something like this
(using System.Diagnostics; )
Code:
foreach (Process process in Process.GetProcessesByName("console"))
{
process.Kill();
}
To start a process use
Code:
Process.Start("console.exe"); // this also returns an instance of the class Process by which you can do other things