I currently have the following up in VS 2010
Dim myProcess() As Process = System.Diagnostics.Process.GetProcessesByName("calc")
For Each myKill As Process In myProcess
myKill.Kill()
However I cannot seem to get it to kill more than one process.
Example I’ve tried
("calc",mspaint")
("calc,mspaint")
("calc"),("mspaint")
Any ideas?
Thanks for your time/support
Quote from MSDN documentation of GetProcessByName:
You can’t pass an array of arguments to it.Instead,you can get all the processes using the GetProcesses method,iterate over all processes and check if its name match one of the names you want:
Non-LINQ way: