Set icon for custom right-click context menu item for all desktop shortcuts (windows explorer)
For Windows 7 & 8 & 10
Add custom item to Context Menu:
Sublime Text 3
Path to the application: C:\Program Files\Sublime Text 3\sublime_text.exe
.
- Run
regedit.exe
(or press Windows Start Button & type: regedit) Goto:
HKEY_CLASSES_ROOT\\*\shell
(
*
is right at the top)- Right_mouse_click shell in left panel for options to create a new Key:
- New > Key
- call it: Sublime Text 3 (or whatever you like to call it)
- Then we create another Key under the one we just created: Right_mouse_click Sublime Text 3 (in fact: your own app's name) in left panel for options to create a new Key:
- New > Key
- call it: command
In the RIGHT panel change (Default) key value (double click or Right_mouse_click & Modify) to:
C:\Program Files\Sublime Text 3\sublime_text.exe %1
In actual fact: your own app's path.
BUT DO ADD THE FOLLOWING AT THE END OF YOUR PATH after a space:%1
.
OPTIONAL: Set Icon + Position in menu:
Icon:
- Click on key you created: Sublime Text 3 (Not it's child we just created: command)
- Create a new String Value for it (Right_mouse_click on RIGHT panel background or menu: edit, then New > Key, choose String Value)
- Call it: Icon
Set it's value as we did for command above to:
"C:\Program Files\Sublime Text 3\sublime_text.exe"
In actual fact: your own app's path
+
Position in context menu:
- Create another String Value where we created Icon just as we did above
- Call it: Position
Set it's Value to:
Top
or if you'd like:
Bottom
NOTE: ICON & POSITION STRING KEYS ARE NOT CREATED IN command
, BUT ITS PARENT: whatever you called your app key in \shell
.
This might be a long shot, but try creating a String value named "Icon" under the HKCL\lnkfile\shell\MY COMMAND
key, and then set the value to the path to your icon (e.g. C:\Program Files\Your Program\YourProgram.exe,0
), assuming your icons are embedded in whatever application you specified to run in your command.
Ok I've worked a bit on this and understood an important thing: If you are on Windows XP or older, you need to do a dll, create GUIDs, reference... a very long task to set only an icon to context menu
Otherwise if you have vista or seven (and it's the technique I'm using) Cory's answer works well.