I have multiple process named COM SURROGATE (dllhost.exe) are running in Task Manager at my System. In which I need to kill all those processes which are running with my USERNAME(One is running with SYSTEM/"" so no need to kill that).
I need to do like below but only for the dllhost process running with myusername :
Process[] runningProcess = Process.GetProcessesByName("dllhost");
if(runningProcess.Length > 0 )
{
foreach (var surrogateProcess in runningProcess)
{
surrogateProcess.Kill();
}
}