@Chand
we encountered similar issues and after an RnD we worked out apattern close to your scenario:
Set up a String List with the process names that get to kill. This can be done also with values from the config
here we go with OUTLOOK, EXCEL, iexplore
then try to retrieve for each process name the process as long all are killed:
for each is iterating over process name to kill list
while is killing the particular process so often till no one longer is existing
We did in this way as we learned that process / childprocess structures confused iteration over process lists. Does mean: A process kill can also kill multiple processes when it come from childprocess relationships. But with this logic we didnt longer mind (Strategy - Kill to end)
Find the XAML here: KillProcesses.xaml (7.5 KB)
Let us know your feedback and flag the solving post as solution. So others can benefit from it.