Windows 7 Hiding menu item from file right click drop down through REGISTRY

matri06

New Member
Joined
Aug 12, 2014
Messages
1
I have introduced a new drop down option "Encrypt" at right click to all file types - therefore I had to add it in the registry as :
HKEY_CLASSES_ROOT\*\shell\Encrypt
Now this drop down would be visible to all type of files at their right click.
But I also have files of type .crypt
HKEY_CLASSES_ROOT\.crypt
HKEY_CLASSES_ROOT\encryptedfile (encryptedfile is defined of type .crypt)
Now I DO NOT want this drop down Encrypt to be visible when I right click files of type .crypt (or encryptedfile)
For the rest of the files the menu Encrypt should be visible (enabled).
How can that be achieved?
I wish this functionality to be achieved by command line Registry modification, not by some third party tool or through C++, C# code
Thank you very much
 

Solution
To control the visibility of the "Encrypt" option in the right-click context menu based on file types in Windows through the registry, you need to leverage the power of shell extensions. This involves adding keys under the appropriate registry paths related to file associations and context menu handlers. Here is a general outline of the steps you can take to achieve this:
  1. Create a New Shell Command: First, you need to define the command you want to execute when the "Encrypt" option is selected.
  2. Define Context Menu Placement: Add or modify the registry entries that define where the "Encrypt" option appears in the context menu using HKEY_CLASSES_ROOT\*\shell.
  3. Conditionally Show/Hide "Encrypt" for .crypt...
To control the visibility of the "Encrypt" option in the right-click context menu based on file types in Windows through the registry, you need to leverage the power of shell extensions. This involves adding keys under the appropriate registry paths related to file associations and context menu handlers. Here is a general outline of the steps you can take to achieve this:
  1. Create a New Shell Command: First, you need to define the command you want to execute when the "Encrypt" option is selected.
  2. Define Context Menu Placement: Add or modify the registry entries that define where the "Encrypt" option appears in the context menu using HKEY_CLASSES_ROOT\*\shell.
  3. Conditionally Show/Hide "Encrypt" for .crypt Files: To conditionally hide the "Encrypt" option for files of type .crypt, you'll need to create additional keys to handle this scenario. Here is a basic example of how you might structure the registry entries:
    • For enabling "Encrypt" for all file types except .crypt files:
      1. Create a key under HKEY_CLASSES_ROOT\*\shell\Encrypt to define the behavior for all files.
      2. In this key, set the command to execute and other relevant settings.
    • For disabling "Encrypt" for .crypt files:
      1. Under HKEY_CLASSES_ROOT\.crypt, create a shell key if one doesn't already exist.
      2. Inside the shell key, create another key like HideEncrypt.
      3. Under HideEncrypt, create a Command value with an empty string or a message like "Not Available" to effectively hide it. Please note that modifying the registry is a sensitive operation that can affect system stability. Ensure you have a backup or create a system restore point before making these changes. Additionally, be cautious and precise with the registry edits to avoid unintended consequences. If you require more specific guidance or code snippets for the exact registry entries to achieve this conditional visibility of the "Encrypt" option, I recommend consulting with a developer who has experience in customizing Windows context menus through the registry.
 

Solution
Back
Top