Enable Task Manager in C# after disabling it
I'm having an issue with reenabling Task Manager after I disable it in C#. It says the registry doesn't exist. Please help.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
jingeRank #2,527 · 554 reputationPosted Oct 21, 2009, 9:17 PM EDT
private void button2_Click(object sender, EventArgs e) { RegistryKey regkey; string subKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"; try { regkey = Registry.CurrentUser.CreateSubKey(subKey); regkey.DeleteValue("DisableTaskMgr"); regkey.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }Kirtan PatelRank #292 · 8.6K reputationPosted Oct 21, 2009, 9:16 PM EDT
Make Sure you Run the Application Under Administrator Rights
if you have made registry changes in HKEY_LOCAL_Machine else it will work without administrator rights if you Disabled
TaskManager From HKEY_CURRENT_USER :)
please check "Do you like this answer" if helps you :)
private void btnEnableTaskManager_Click(object sender, EventArgs e)
{
RegistryKey rkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System\", true);
rkey.DeleteValue("DisableTaskMgr", true);
rkey.Close();
try
{
RegistryKey rkey2 = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System", true);
rkey.DeleteValue("DisableTaskMgr", true);
rkey2.Close();
}
catch
{
}
MessageBox.Show("Regitry Enabled !!");
}
Bryan108 reputationPosted Oct 21, 2009, 9:19 PM EDT