How to Add a Ribbon Command to the Right-click Menu in Windows 10?

Ribbon UI consists of a command bar with a series of tabs. Each tab contains a set of commands such as Cut, Copy, Paste etc. Ribbon UI was first introduced in Office 2007. Then it was included in the File Explorer in Windows 8 and Windows 10.

This article explains how to add any Ribbon command from File Explorer to the right-click menu for files or folders.

ribbon command in right-click menu
File Explorer Ribbon UI

The standard tabs in the File Explorer Ribbon are File, Home, Share, and View — each containing a set of commands. Besides these standard tabs, additional contextual tab(s) appears dynamically, based on the type of file you select in a folder. In Windows 10, the registry entries for each Ribbon command is stored under the “CommandStore” registry key.

To access the CommandStore key, start the Registry Editor (regedit.exe) and go to the following branch:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell

See also: Using RegJump to Quickly Jump to a Registry Path

ribbon command in right-click menu

Each subkey corresponds to a Ribbon command in File Explorer. For example, the key “Windows.PermanentDelete” powers the “Permanently Delete” command, which is a sub-command under “Delete” in the Ribbon UI.

By tweaking the registry, you can add this item or any other Ribbon command to the right click menu.

Example 1: Add “Permanently Delete” command to right-click menu

To add “Permanently Delete” option to the context menu for files, you need to copy the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.PermanentDelete

to the following key:

HKEY_CLASSES_ROOT\*\shell\Windows.PermanentDelete

This can be done by exporting the 1st key to a .REG file (via File – Export command in the Registry Editor). Then, edit the file with Notepad and change the following path:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.PermanentDelete

to


HKEY_CLASSES_ROOT\*\shell\Windows.PermanentDelete

After editing, the file should look like this:

ribbon command in right-click menu

Save the REG file, and double-click to run it.

This adds the “Permanently Delete” option to the right-click menu for all files.

ribbon command in right-click menu

Quick Tip: You can set this key only on a per-file type basis, or for all file types, folders or both files & folders. However, it makes perfect sense to add the “Delete Permanently” command only for (all) files. Adding it to Folders will work, but there is always a risk of accidental deletion of an entire folder — but it’s your call.

To add the Ribbon command for folders, you’d copy it to the following branch:

HKEY_CLASSES_ROOT\Directory\shell

To implement it for both files and folders, add it here:

HKEY_CLASSES_ROOT\AllFileSystemObjects\shell

Example 2: Add “Copy as Path” to right-click menu

By bringing the “Copy as Path” ribbon command to the right-click menu, you can make the “Copy as Path” right-click option appear by default without having to press the SHIFT key when right-clicking.

Note that the standard “Copy as Path” extended menu command would still show up if using the SHIFT key. So when using SHIFT right-click on a file, there will essentially be two “Copy as Path” commands.

For more information, check out the following article: Show “Copy as Path” Always in Right-Click Menu Without Shift Key.

Show “Copy as Path” Always in Right-Click Menu Without Shift Key

About the author

Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and has a vast experience in the ITeS industry — delivering support for Microsoft's consumer products. He has been a Microsoft MVP [2003 to 2012] who contributes to various Windows support forums.

Leave a Comment