I would like to find all the WINWORD tasks running on my windows 2003 server
and END them. Where can I find how to write such code in c#?
Thanks
Pramod Anchuparayil - 29 Jun 2007 17:26 GMT
You can use the GetProcessByName method for the Process class to do this.
Here's an example.
string processName = "winword";
Process[] processByNameList =
Process.GetProcessesByName(processName);
foreach (Process p in processByNameList) {
p.Kill(); }
don't forget to add using System.Diagonistics namespace reference to the top
>I would like to find all the WINWORD tasks running on my windows 2003
>server and END them. Where can I find how to write such code in c#?
>
> Thanks
tim djossou - 30 Jun 2007 09:54 GMT
Thanks
> You can use the GetProcessByName method for the Process class to do this.
> Here's an example.
[quoted text clipped - 12 lines]
>>
>> Thanks
Alex Meleta - 29 Jun 2007 17:27 GMT
Hi,
E.g. foreach (Process process in Process.GetProcessesByName("winword")) process.Kill();
Regards, Alex
http://devkids.blogspot.com
> I would like to find all the WINWORD tasks running on my windows 2003
> server and END them. Where can I find how to write such code in c#?
>
> Thanks
tim djossou - 30 Jun 2007 09:55 GMT
thanks
> Hi,
>
[quoted text clipped - 8 lines]
>>
>> Thanks