var prcName = "Proc";
Process[] processByName= Process.GetProcessesByName(Proc);
var curId = Process.GetCurrentProcess().Id;
var procName = Process.GetCurrentProcess().ProcessName;
var processes = Process.GetProcesses().Where(p => p.ProcessName == procName && p.Id != curId).ToList();
processes.ForEach(p => p.CloseMainWindow());