[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
  • @ lurch6661:
    iam good
  • @ lurch6661:
    got my bd disc in
  • @ lurch6661:
    it comes with games lol
  • @ QM|T:
    lol
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    Tural is our newest member. Welcome!
  • Chat Bot:
    Pharaotix is our newest member. Welcome!
  • Chat Bot:
    Duran_1911 is our newest member. Welcome!
  • Chat Bot:
    LilBoat100 has left the room.
  • Chat Bot:
    keonhacaivoto is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    estro101 is our newest member. Welcome!
  • Chat Bot:
    yeclipsex is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    Diabloron is our newest member. Welcome!
  • Chat Bot:
    mr kiki is our newest member. Welcome!
  • Chat Bot:
    NorwayVon is our newest member. Welcome!
  • Chat Bot:
    QM|T has joined the room.
  • Chat Bot:
    cynthia is our newest member. Welcome!
  • Chat Bot:
    LilBoat100 has joined the room.
  • @ LilBoat100:
    been a min
  • @ LilBoat100:
    i have uncharted 3, (digital) my disc aint working for shit lol, so whenever i try finding "LAN Party" its not on digital, only on disc. so if theres like a eboot maybe, or something i can do to activate the LAN Party to play offline, that shit would be dope bro. anyone.
  • @ LilBoat100:
    or maybe if i download it as iso? idk
      @ LilBoat100: or maybe if i download it as iso? idk