❬ Back to Blog
Add entry to the windows context menu via registry
Want to have extra items on your context menu? Here is how!
Hi folks,
this post I will be showing how you can add entries to the context menu in windows.
In this example I will be creating a shortcut that will open all selected images (not just one) [.bmp, .png, .jpg and so on] with Photoshop.
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\Open With Photoshop\command] | |
@="\"P:\\Programs\\Adobe\\Adobe Photoshop CS5 (64 Bit)\\photoshop.exe\" \"%1\"" | |
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer] | |
"MultipleInvokePromptMinimum"=dword:00000016 |
Lets break that code down:
Line 1
- Version of Registery Editor used.
Line 2
- blank space
Line 3
- Here you specify the associated file types and storage of the command: HKEY_CLASSES_ROOT\SystemFileAssociations\image
And that you want to execute a command on the program listed then after. You can also change the name: \Open With Photoshop\
Just replace "Open With Photoshop" with your name.
Line 4
- Full path to the program you want the files to be opened with. Note that the back slashes are escaped using double slashes.
Line 5
- blank space
Line 6
- This will tell the registry where to link the action. Should be linked to the currentVersion of Windows in the explorer.
Line 7
- Last line will store the info in a dword value that can be read by Windows.
Once done you have the option in your context menu now:
Edit every file with your editor
You can do this will almost every program. And also change the action to something different if you like.
For example if you want to have an edit action on every filetype for Sublime Text 3 you can do this:
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\*\shell\Edit with Sublime Text 3\command] | |
@="\"P:\\Programs\\Sublime Text 3\\sublime_text.exe\" \"%1\"" | |
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer] | |
"MultipleInvokePromptMinimum"=dword:00000016 |
That will be then listed as (below Run as administrator):
Thats it. I hope this will help some people.
Over and out,
Aebian