title: How to kill an instance of an application
body: <p>I am having a text file in this path "C:\Test\test.txt" when this was openeed I need to close this.</p>
  
  <p>When I am trying to use the below code all the instances of notepad are closing and I don't want that to be happened and I want to close only the ".txt" file:</p>
  
  <p>Any help would be appreciated!</p>
  
  <p>Here is my code:</p>
  
  <pre><code> Dim Process() As Process = System.Diagnostics.Process.GetProcessesByName("notepad")
    For Each p As Process In Process
      p.Kill()
  Next 
  </code></pre>