how to kill process in Windows-CE?

Gali picture Gali · Sep 5, 2011 · Viewed 13.5k times · Source

How can I kill process Windows\MyProcc.exe from my terminal (Windows-CE 5.0) using C# code?

Answer

First find the Process by giving the running exe's name and kill it. Use the System.Diagnostics namespace.

Process[] Prs = Process.GetProcessesById(RunninExe);
if (Prs.Length > 0)
{
      foreach (Process Prss in Prs)
      {
          Prss.Kill();
      }
}