How do I disable file explorer and start menu using C#

Kalpana 246 Reputation points


I found this code to disable the task manager and it works like a charm.

        public static void enable()
                RegistryKey objRegistryKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");
            public static void disable()
                RegistryKey objRegistryKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");
                if (objRegistryKey.GetValue("DisableTaskMgr") == null)
                    objRegistryKey.SetValue("DisableTaskMgr", "1");

                //RegistryKey regkey;
                //string keyValueInt = "1";
                //string subKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System";

                //    regkey = Registry.CurrentUser.CreateSubKey(subKey);
                //    regkey.SetValue("DisableTaskMgr", keyValueInt);
                //    regkey.Close();
                //catch (Exception ex)
                //    Console.WriteLine(ex.Message);

I have got a requirement from the user where I have to disable the user from clicking the file explorer, the search box that appears in the taskbar and the start menu.

What registry keys should I use and what are the other options, tweaking registry key and enabling them back seems easier...but I am open to suggestions and advice.. I am not able to find the appropriate keys to disable the file explorer and the others..
Please advice.

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,205 questions
{count} votes

Accepted answer
  1. Castorix31 71,716 Reputation points

    You can disable Start Menu or other windows with Low Level Hooks (WH_MOUSE_LL + WH_KEYBOARD_LL)

    You return 1 do disable the event (for example when vkCode == Keys.LWin in the Keyboard procedure)

    I don't see what you mean by "clicking the file explorer" (Explorer is the default Shell (Winlogon key))

0 additional answers

Sort by: Most helpful