Search This Blog

Friday, November 4, 2022

Registry: Modifying the context menu

Whenever you are right-clicking in your explorer or on your desktop you bring out what is called the context menu.

After doing some research and testing I found ways to add programs of my liking to this menu by editing the registry.

In this example, I used pestudio, a program that you can investigate .exe-files with. You can download it from this page for free. I wanted to add this program to the menu in order to open other files with it.

Step one is to navigate to HKEY_CLASSES_ROOT\*\shell\ 

Then you create a subkey called whatever you want the menu to display, such as "Open with PE". Within this key you then create another key called command, and this is something you do regardless of what program you are going to add.

Step two is to edit the default file located in "command". Set the value to the file path within quotation marks, followed by space, followed by %1 in quotation marks. For example:

"C:\Program Files (x86)\pestudio\pestudio.exe" "%1"

Step three is to add an icon. Enter the parent key this time, by clicking on "Open with PE". Within this key you create a string named Icon with the file path as data. Make sure to put a comma and a 0 at the end to retrieve the built in icon:

Now you should be able to see the icon, the menu name and the program you linked should be able to open the files that you right click.

If you want to turn this into a .reg-file you can use this code:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Open with PE\command]
"(Default)"="\"C:\Program Files (x86)\pestudio\pestudio.exe\" \"%1\""

[HKEY_CLASSES_ROOT\*\shell\Open with PE]

"Icon"="C:\Program Files (x86)\pestudio\pestudio.exe,0"


No comments:

Post a Comment