[C#] End Processes

  • Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

Elite_Modz

Active Poster
Retired Staff
Active Member
Console ID Poster
Dec 19, 2014
517
380
133
Crunch
Update 1

Code:
Code:
public static void EndTask(string taskname)
  {
  string processName = taskname;
  foreach (Process process in Process.GetProcessesByName(processName))
  {
  process.Kill();
  }
  }

Code:
Code:
EndTask(notepad);

Notes:
Program needs admin privelages.
Filetypes such as (.exe) are Not Supported
 
Last edited:
Code:
Code:
public static void EndTask(string taskname)
  {
  string processName = taskname;
  Process[] processes = Process.GetProcessesByName(processName);
  foreach (Process process in processes)
  {
  process.Kill();
  }
  }

Code:
Code:
EndTask(notepad);

Notes:
Program needs admin privelages.
You don't need to put .exe at the end of the name.


THANK MATE ;)
 
  • Like
Reactions: Elite_Modz
Update 2:

Code:
Code:
public static void EndTask(string taskname)
  {
  string processName = taskname;
  string fixstring = taskname.Replace(".exe", "");

  if (taskname.Contains(".exe"))
  {
  foreach (Process process in Process.GetProcessesByName(fixstring))
  {
  process.Kill();
  }
  }
  else if (!taskname.Contains(".exe"))
  {
  foreach (Process process in Process.GetProcessesByName(processName))
  {
  process.Kill();
  }
  }
  }

Code:
Code:
EndTask("notepad");

Notes:
Program needs admin privelages
Fixed: Filetypes such as (.exe) are Now Supported
 
Last edited:
Update 2:

Code:
Code:
public static void EndTask(string taskname)
  {
  string processName = taskname;

  if (taskname.Contains(".exe"))
  {
  string fixstring = taskname.Replace(".exe", "");
  Process[] processes = Process.GetProcessesByName(fixstring);
  foreach (Process process in processes)
  {
  process.Kill();
  }
  }
  else if (!taskname.Contains(".exe"))
  {
  Process[] processes2 = Process.GetProcessesByName(processName);
  foreach (Process process in processes2)
  {
  process.Kill();
  }
  }
  else
  {

  }
  }

Code:
Code:
EndTask(notepad);

Notes:
Program needs admin privelages
Fixed: Filetypes such as (.exe) are Now Supported

Most of that is totally unnecessary, you could kill a process in just like 3 lines.
 
Most of that is totally unnecessary, you could kill a process in just like 3 lines.
That's Correct, like so:
Code:
  foreach (Process process in Process.GetProcessesByName("notepad"))
  {
  process.Kill();
  }
 
That's Correct, like so:
Code:
  foreach (Process process in Process.GetProcessesByName("notepad"))
  {
  process.Kill();
  }
So why all the extra code?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Chat Bot:
    BILL Beast is our newest member. Welcome!
  • @ BILL Beast:
    hello im new to this are they a working mod menu for ps3 bo1 cex?
  • Chat Bot:
    pg99guru1 is our newest member. Welcome!
  • Chat Bot:
    fly88soccerr is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • @ QM|T:
    :weed:
  • Chat Bot:
    Christo has joined the room.
  • Chat Bot:
    ANGUS0023233 has joined the room.
  • Chat Bot:
    jbossman is our newest member. Welcome!
  • Chat Bot:
    thapcamtvagencyy is our newest member. Welcome!
  • Chat Bot:
    ANGUS0023233 has joined the room.
  • Chat Bot:
    new8kbetcomm is our newest member. Welcome!
  • Chat Bot:
    fun88adult1 is our newest member. Welcome!
  • Chat Bot:
    fun88adult is our newest member. Welcome!
  • Chat Bot:
    new8xbetcom2 is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    Ponetialy is our newest member. Welcome!
  • Chat Bot:
    Devblind25 is our newest member. Welcome!
  • Chat Bot:
    xMTNDEW is our newest member. Welcome!
  • Chat Bot:
    CountryBoy25307 is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    qq88gscom2 is our newest member. Welcome!
  • Chat Bot:
    Christo has joined the room.
  • Chat Bot:
    xn88fan1 is our newest member. Welcome!
  • Chat Bot:
    ANGUS0023233 has joined the room.
      Chat Bot: ANGUS0023233 has joined the room.