Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Using Task Manager we can kill an application. I want to kill an application without using Task Manager. Not closing or exit.

What I have tried:

I have tried something to get the Task Manager options but I am not able to do
Posted
Updated 14-Apr-16 20:35pm
Comments
PIEBALDconsult 15-Apr-16 0:36am    
How about: http://www.codeproject.com/Articles/6072/Win-APIs-for-Process-Retrieval
Sergey Alexandrovich Kryukov 15-Apr-16 2:47am    
It's not a problem to kill a process, but doing it in a regular application is the abuse. Why? (And how do you think it can be related to Forms?) You need to design code the way it terminates nicely, without killing.
—SA

1 solution

Try this.
C#
foreach (Process Proc in Process.GetProcesses())
     if (Proc.ProcessName.Equals("EXCEL"))  //Process Excel?
          Proc.Kill();


For More please follow below links...
kill in process in task manager[^]
kill process by name and user name using C#?[^]
kill process in task manager[^]

Regards,
AARIF SHAIKH
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900