Friday, October 15, 2010

C# Tutorial: How to Disable Task Manager

Here is the code

/* 
    * NOTE: 
    * - You must have administrator privileges or this won't work !!!
    * - You must run VC# 2010 as Administrator or (again) this won't work !!!
    */
RegistryKey key = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"); 
private void button1_Click(object sender, EventArgs e)
{
    key.SetValue("DisableTaskMgr", 1); 
}

private void button2_Click(object sender, EventArgs e)
{
    Registry.CurrentUser.DeleteSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
    // Or you can change the key value to 0
}

Or download the solution

1 comment:

  1. świetnee ! :D, będzie można zrobić znajomemu lub siostrze żarta :d

    ReplyDelete