When working with Windows 7 RC this week, I stumbled upon another nice and useful feature which I thought I should write about. Windows 7 allows you to add icons to your custom right-click (static) menu entries. Usually, to display a right-click command with an icon, one needs to write a context menu handler Shell Extension (DLL). Now, you can assign icons for static menu items as well, without having to program anything.

For example, when you add a custom right-click command "Print Directory" using the instructions in article How to add the Print Directory feature for file system folders in Windows 7 & Vista, you see this when you right-click on a directory.

So far so good. Now, you can mention an icon reference which either points to an icon resource inside a DLL/EXE file, or an .ico file.

Add an Icon to a Right-Click Menu Entry

1. Click Start, type Regedit.exe and press ENTER

2. Navigate to the corresponding registry key for the menu item. For example, if you used the previously mentioned link to add the Print Directory command to the context menu, navigate to the following key:

HKEY_CLASSES_ROOT \ Directory \ Shell \ PrintDir

3. In the right-pane create a String value (REG_SZ) named Icon

4. Double-click Icon and type the path to an icon (.ico) file, or mention the icon library file name and the icon index.

5. Exit the Registry Editor.

Now, right-click on a directory and you’ll see a printer icon near the Print Directory command.

How cool is that?

Related Posts


Email SubscriptionPrefer an E-mail subscription?

Enter your email address:

Delivered by FeedBurner

10 Comments

  1. anshuman
    said this on Saturday, August 14th 2010 4:36 pm

    i want to put an icon near “nvidia control panel” in the windos right click menu. can u help me ?

  2. said this on Friday, June 4th 2010 6:34 pm

    Is there a way for XP Please!!!!!!
    Or is there a simple way for creating context menu handlers you mentioned?

  3. Neil Walker
    said this on Wednesday, January 13th 2010 6:00 pm

    Yes, please show us how to add icons in WinXP.

  4. suloku
    said this on Sunday, December 13th 2009 11:28 pm

    How to do this on windows xp please?

  5. said this on Friday, November 27th 2009 8:06 pm

    @anonymous: Adding icons to custom context menu does not remove icons from IE Command Bar. It’s something else.

  6. anonymous
    said this on Friday, November 27th 2009 5:08 pm

    But why did they have to remove the icons from the command bar in Explorer?

  7. David
    said this on Wednesday, November 25th 2009 2:43 pm

    Works in Windows 7, at least. Thanks for telling us how!

  8. said this on Sunday, September 13th 2009 4:36 am

    What to do to change the icons for SendTo. I tried this guide, but did not work.

  9. hashem
    said this on Monday, August 3rd 2009 11:03 pm

    not work on windows vista

  10. Jim
    said this on Tuesday, June 23rd 2009 6:59 pm

    Good trick, but can this be replicated in WinXP

Leave a Reply