This code is usefully if your application output value is full path.
Vb.net Code:
  1. Try
  2.             Dim filePath As String = "C:\Users\user\Desktop\appname.exe"
  3.             Dim folderPath As String = IO.Path.GetFullPath(filePath)
  4.             Dim Namer As String = IO.Path.GetFileNameWithoutExtension(filePath)
  5.             For Each p As Process In Process.GetProcessesByName(Namer)
  6.                 p.CloseMainWindow()
  7.                 p.WaitForExit(10000)
  8.                 If Not p.HasExited Then
  9.                     p.Kill()
  10.                 End If
  11.             Next
  12.         Catch ex As Exception
  13.             MessageBox.Show(ex.Message)
  14.         End Try