Rashmi kaneri

Rashmi kaneri

  • NA
  • 6
  • 5.7k

how to get processes belonging to Win32 in c#

Sep 8 2016 12:51 AM
My requirement is to find the processes belonging win32 and kill them.
i have written code as given below but it gives all the processes including Win64.
i searched many sites for the same but could not get what i needed.
can someone help me on this......
 
Process[] ListofProcess = Process.GetProcesses();
foreach (Win32_Process prossesitem in ListofProcess)
{
if ((Equals(prossesitem, strProcessName) == true))
{
prossesitem.Kill();
}
}

Answers (2)