Adding Context-Sensitive Context Menu Entries to HTML Files in Windows 10
In Windows 10, you can customize the context menu that appears when you right-click on a file or folder. This is useful for adding frequently used actions or tools to the context menu, so you can quickly access them without having to navigate through multiple layers of menus. This article will focus on adding a context-sensitive context menu entry specifically for HTML files.
The Need for Context-Sensitive Context Menu Entries
Suppose you have a HTML file, and you want to quickly open it in your preferred web browser. By default, Windows 10 only shows the "Open" and "Open with" options in the context menu. To add a context-sensitive context menu entry for HTML files, you can create a registry key that associates the action with the HTML file type.
Creating a Context-Sensitive Context Menu Entry for HTML Files
To create a context-sensitive context menu entry for HTML files in Windows 10, follow these steps:
- Press Win + R to open the Run dialog. Type "regedit" and press Enter to open the Registry Editor.
- Navigate to the following registry key:
HKEY\_CLASSES\_ROOT\.htmlNote that this key is for HTML files specifically. If you want to create a context menu entry for a different file type, replace ".html" with the appropriate file extension.
- Create a new key called "Shell" if it doesn't already exist.
- Create a new subkey under "Shell" called "OpenWithMyBrowser."
- Create a new subkey under "OpenWithMyBrowser" called "command."
- In the "command" subkey, create a new string value called "DelegateExecute." Set its value to the path of your preferred web browser, including the executable filename.
C:\Program Files (x86)\Google\Chrome\Application\chrome.exeBy setting the "DelegateExecute" value to the path of your preferred web browser, you are telling Windows 10 to launch the browser when the "Open With My Browser" context menu entry is clicked.
HKEY\_CLASSES\_ROOT
> .html
> Shell
> OpenWithMyBrowser
> command
Testing the Context-Sensitive Context Menu Entry
To test the context-sensitive context menu entry for HTML files, follow these steps:
- Close the Registry Editor.
- Find an HTML file on your computer. Right-click on the file.
- The new context menu entry, "Open With My Browser," should be visible.
- Click on the new context menu entry to open the HTML file in your preferred web browser.
In this article, you learned how to add a context-sensitive context menu entry for HTML files in Windows 10. By creating a registry key that associates the action with the HTML file type, you can quickly open HTML files in your preferred web browser without having to navigate through multiple layers of menus. This can save time and improve productivity for web developers and designers who frequently work with HTML files.
References
- Customizing the context menu using the registry (Microsoft Support)
- Registry keys and values for file associations (Microsoft Docs)