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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
jingePosted Oct 22, 2009, 1:17 AM
BryanPosted Oct 22, 2009, 1:19 AM
Kirtan PatelPosted Oct 22, 2009, 1:16 AM
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 !!");
}