There is a code that should complete the process that was launched from the specified folder:
namespace newkill { class Program { static void Main() { } string path = @"C:\Users\" + Environment.UserName + @"\AppData\Roaming\WindowsW0W32\"; public static void KillProcesses(string path) { Process.GetProcesses() // получаем все процессы .Where(p => CheckIfProcessFileEquals(p, path)) // берем только те, в которых пути к файлу совпадают .ToList() .ForEach(p => p.Kill()); // убиваем каждый } private static bool CheckIfProcessFileEquals(Process process, string path) { try { return process.MainModule.FileName.Equals(path, StringComparison.InvariantCultureIgnoreCase); // сравниваем пути, инорим кейс } catch (Win32Exception) { return false; // если MainModule недоступен - скипаем } } } } The file was launched from this folder - C:\Users\" + Environment.UserName + @"\AppData\Roaming\WindowsW0W32\ but after the program execution the process is not killed. What could be wrong? Version .NET 3.5