Category Archives: .NET

Disabling Task Manager on Windows in .NET way hack

By now, all of you ( & yours truly ) using windows must have encountered the situation, when you press your favorite savior Ctrl + Alt + Del, and your "Task Manager" doesn't pops up and you are in hell…

Sometimes, scanning registry fixes it, if poor virus has just disabled TM through reg key hack, but what if you don't want to hack reg/ probably you don't know the hive in which TM keys are set.

There is a simple way to do this, Kill the poor TM, before it has a chance to help its poor user (and you are the murderer). The .NET base class provides a very easy way to do this (And me and you thought .NET is like angel Java, meant to do only good things), here it is:

use the static Process class defined in .NET namespace System.Diagnostics

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
namespace ProcKiller
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>

        [STAThread]
        static void Main()
        {
            string[] ProcName = new string[1];

// We are defining here our targets, which we will kill, if present | Hell yeah! its a bloody game…
ProcName[0] = "taskmgr";


            while (true)
            {
                foreach (string Proc in ProcName)
                {
                    Process[] Pro = Process.GetProcessesByName(Proc); // using System.Diagnostics.Process


                    if (Pro.Length != 0)
                    {
                        try
                        {
                            Pro[0].Kill();
                        }
                        catch
                        {
                            //dummy catch – do nothing
                        }
                    }
                }
                System.Threading.Thread.Sleep(100); // Use this line, if you don't want the CPU usage to pop to ~ 90 – 100%
            }
        }
    }
}

Assignment : use this implementation to do something useful, non-annoying (really useful), by the way, I have already done one

final word to my close friends: Don't even think of using it against me, I already have my own defenders and weaponery

 

p.s: if you get stuck in how to really make it, or how to get rid of it, once it start running, mail me your problem specifically and briefly to mailto:[email protected]