Отключить запуск определенных приложений
Hello everyone. This code below is used to block run certain applications. It works, but to make the effect visible you need to restart the machine. I would like to do this without having to restart the machine. How can I do this without a restart? Is there a possibility of reboot machine without restarting? Thanks in advance.
Что я уже пробовал:
private void blockRunApp() { try { Registry.SetValue("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", "DisallowRun", 1); Microsoft.Win32.RegistryKey rkey; rkey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\DisallowRun"); rkey.SetValue("Appname", "App.exe"); rkey.Close(); } catch { } }