title: How to kill a list of processes in c#
body: <p>I am new to C# and am trying to kill a list of processes. I was able to use the code below to kill one process but would like to change it so that it kills a list of processes. Over time the list will grow so ideally I would like to find a way to do this where updating the list would be quick and easy.</p>
  
  <pre><code>try
  {
      foreach (Process proc in Process.GetProcessesByName("notepad"))
      {
          proc.Kill();
      }
  }
  catch (Exception)
  {
      Console.WriteLine("Procces not found.");
  }
  </code></pre>
  
  <p>I'm sorry if I have overlooked a question that was already asked about this.
  Thank you in advance for any help provided.</p>