禁用系统功能

禁用系统功能

1. 禁用任务管理器

//禁用
var subKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", RegistryKeyPermissionCheck.ReadWriteSubTree);
subKey.SetValue("DisableTaskMgr", "1");  
//启用
RegistryKey subKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
subKey.DeleteValue("DisableTaskMgr");

2. 禁用注册表(测试无效)

//禁用
var subKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", RegistryKeyPermissionCheck.ReadWriteSubTree);
subKey.SetValue("DisableRegistryTools", "1");  
//启用
RegistryKey subKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System");
subKey.DeleteValue("DisableRegistryTools");

3. 修改桌面管理器(explorer.exe)为自己的程序

RegistryKey subKey = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon");
//这个值设置为自己的程序
subKey.SetValue("Shell", @"D:\Test.exe");
//恢复
RegistryKey subKey = Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon");
subKey.SetValue("Shell", "explorer.exe");
posted @ 2019-11-07 14:15  Net_win  阅读(228)  评论(0编辑  收藏  举报