Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set icon for custom right-click context menu item for all desktop shortcuts (windows explorer)

Tags:

registry

I learned how to add an item to the right-click context menu, but I would like to add an icon too. I tested adding a value Icon to the key (imagine that the key is HKCL\lnkfile\shell\MY COMMAND\command, I added the icon value to HKCL\lnkfile\shell\MY COMMAND) but it doesn't work, I put the path to the icon inside it but it's 32x32, maybe is that the problem maybe no... do someone know how to add an icon to my menu item?

Thanks for any answer

like image 911
Francesco Belladonna Avatar asked Sep 09 '10 22:09

Francesco Belladonna


People also ask

How do I put shortcut icons in mouse right click new menu?

You can also add any application to the desktop right-click menu pretty easily. Just right-click on the shell key and choose New – Key. Name the key whatever you want as that will appear in the context menu.

How do I add a program to the right click context menu?

Add Any Program to Context Menu. Open the registry and navigate to the following path: HKEY_CLASSES_ROOT\Directory\Background\shell then right-click on shell and select New > Key. Give the new key the name of the program you're adding to the context menu.

How do I customize the context menu in Windows 10?

Press the Windows key and R simultaneously, type regedit and press Enter. Navigate to HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers and you will see a series of keys that related to existing menu entries. It is easy to delete any you no longer need access to – just right click a key and select Delete.


2 Answers

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.

  1. Run regedit.exe (or press Windows Start Button & type: regedit)
  2. Goto:

    HKEY_CLASSES_ROOT\\*\shell 

    (* is right at the top)

  3. Right_mouse_click shell in left panel for options to create a new Key:
    1. New > Key
    2. call it: Sublime Text 3 (or whatever you like to call it)
  4. 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:
    1. New > Key
    2. call it: command
  5. 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:

  1. Click on key you created: Sublime Text 3 (Not it's child we just created: command)
  2. Create a new String Value for it (Right_mouse_click on RIGHT panel background or menu: edit, then New > Key, choose String Value)
  3. Call it: Icon
  4. 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:

  1. Create another String Value where we created Icon just as we did above
  2. Call it: Position
  3. 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.

like image 102
washere Avatar answered Sep 21 '22 04:09

washere


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.

like image 34
Cᴏʀʏ Avatar answered Sep 22 '22 04:09

Cᴏʀʏ