Use the KillProcess function given below: You need to just pass the process name. For example, to kill excel application, make a call to KillProcess("Excel"). Even if there are many instances of excel application, this function would kill all the processes with the same name.
void KillProcess(string processName)
Process proc = Process.GetProcessesByName(processName);
foreach (Process p in proc)