I'm trying to:
1) get a list of all executables in a directory and all subdirectories.
2) if any of those executables is running, kill the process.
What I have so far:
String[] exes =
Directory.GetFiles("C:\\Temp", "*.EXE", SearchOption.AllDirectories)
.Select(fileName => Path.GetFileNameWithoutExtension(fileName))
.ToArray();
{
exes.ToList().ForEach(Console.WriteLine);
}
Console.ReadLine();
So this shows me a list of the executables. How do I use this list to kill the processes, if they are running?