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

4 Comments

  1. said this on Sunday, July 3rd 2011 3:09 pm

    [...] for Ashampoo Malware when I right-click for easy finding it. After reading about a similarity here: How to Add Icons to Custom Right-Click Menu (Context Menu) in Windows 7 – The Winhelponline Blog I think I have a clue, but I'm not technical enough to try adding any new keys to the registry: [...]

  2. Peter Rudnik
    said this on Thursday, February 3rd 2011 4:10 pm

    I tried this with an icon file like

    c:\temp\my.ico

    on

    xmlfile\shell\command

    with a programm like c:\temp\myprogramm.exe

    and that does not work.

  3. Burke
    said this on Thursday, October 21st 2010 4:00 am

    How can I place an icon next to the delete (file; folder) entry?

    Appriciate your expertise, thanks in advance, greeting from Germany, Bure

  4. 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 ?

Leave a Reply