{"id":906,"date":"2009-06-22T12:31:14","date_gmt":"2009-06-22T07:01:14","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=906"},"modified":"2021-06-19T21:58:35","modified_gmt":"2021-06-19T16:28:35","slug":"add-icon-to-right-click-menu-windows-7","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/add-icon-to-right-click-menu-windows-7\/","title":{"rendered":"How to Add Icon to a Context Menu Item in Windows"},"content":{"rendered":"<p>When working with Windows 7 RC this week, I stumbled upon another nice and useful feature that I thought I should write about. In Windows 7 and higher, you can add icons to your custom right-click (static) menu entries.<\/p>\n<p>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.<\/p>\n<p>The instructions in this article apply to Windows 7 through Windows 10.<\/p>\n<p><!--more--><\/p>\n<p>For example, when you add a custom right-click command &#8220;Print Directory&#8221; using the instructions in the article <a href=\"https:\/\/www.winhelponline.com\/blog\/print-directory-contents-using-chrome-firefox\/\" target=\"_blank\" rel=\"noopener noreferrer\">Print directory contents<\/a>\u00a0you see this when you right-click on a directory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived\/w7-icon-static-menu1.png\" width=\"290\" height=\"394\" \/><\/p>\n<p>So far so good. Now, you can mention an icon reference which either points to an icon resource inside a .DLL, .EXE, or an .ICO file.<\/p>\n<h2>Add an Icon to a Right-Click Menu Entry<\/h2>\n<ol>\n<li>Launch the Registry Editor (<code>regedit.exe<\/code>)<\/li>\n<li>Navigate to the corresponding registry key for the menu item. For example, if you used the previously mentioned link to add the <b>Print Directory<\/b> command to the context menu, navigate to the following key:\n<pre>HKEY_CLASSES_ROOT\\Directory\\Shell\\PrintDir<\/pre>\n<\/li>\n<li>In the right pane, create a String value (REG_SZ) named <b>Icon<\/b><\/li>\n<li>Double-click <b>Icon<\/b> and type the path to an icon (.ico) file. Or mention the icon library file name and the icon index.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived\/w7-icon-static-menu2.png\" width=\"551\" height=\"119\" \/><\/li>\n<li>Exit the Registry Editor. Now, right-click on a directory and you&#8217;ll see a printer icon near the <b>Print Directory<\/b> command.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived\/w7-icon-static-menu3.png\" width=\"289\" height=\"394\" \/><\/li>\n<\/ol>\n<p>The above registry edit works in Windows 7 through Windows 10.<\/p>\n<div class=\"rp\"><strong>RELATED:<\/strong> <a href=\"https:\/\/www.winhelponline.com\/blog\/add-uac-shield-icon-right-click-context-menu-windows-7\/\">How to Add UAC Shield Icon for a Right-Click Menu Item in Windows<\/a><\/div>\n<h3>Other Examples<\/h3>\n<figure id=\"attachment_4866\" aria-describedby=\"caption-attachment-4866\" style=\"width: 665px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4866\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/04\/open_with_notepad.png\" alt=\"add open with notepad to right-click\" width=\"675\" height=\"228\" \/><figcaption id=\"caption-attachment-4866\" class=\"wp-caption-text\">&#8220;Open with Notepad&#8221; context menu entry with Notepad icon.<\/figcaption><\/figure>\n<p>Reference: <a href=\"https:\/\/www.winhelponline.com\/blog\/add-the-open-with-notepad-context-menu-option-for-all-file-types\/\">Add \u201cOpen with Notepad\u201d to the Right-click Menu<\/a><\/p>\n<figure id=\"attachment_8743\" aria-describedby=\"caption-attachment-8743\" style=\"width: 529px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-8743 size-full\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-menu.png\" alt=\"Notepad++ right-click menu in Windows\" width=\"539\" height=\"225\" \/><figcaption id=\"caption-attachment-8743\" class=\"wp-caption-text\">&#8220;Open with Notepad++&#8221; context menu &#8212; with Notepad++ icon.<\/figcaption><\/figure>\n<p>Reference: <a href=\"https:\/\/www.winhelponline.com\/blog\/open-with-notepad-plus-right-click-menu-windows\/\">Add \u201cOpen with Notepad++\u201d to the Right-Click Menu<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When working with Windows 7 RC this week, I stumbled upon another nice and useful feature that I thought I should write about. In Windows 7 and higher, you can 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 &#8230; <a title=\"How to Add Icon to a Context Menu Item in Windows\" class=\"read-more\" href=\"https:\/\/www.winhelponline.com\/blog\/add-icon-to-right-click-menu-windows-7\/\" aria-label=\"Read more about How to Add Icon to a Context Menu Item in Windows\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[7],"tags":[441],"class_list":["post-906","post","type-post","status-publish","format-standard","hentry","category-windows","tag-registry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":4261,"url":"https:\/\/www.winhelponline.com\/blog\/print-directory-contents-using-chrome-firefox\/","url_meta":{"origin":906,"position":0},"title":"How to Print Directory Contents Using Different Methods","author":"Ramesh","date":"October 4, 2016","format":false,"excerpt":"You can copy folder contents by selecting all items in a folder, pressing Shift key and clicking the Copy as Path command in the right-click menu. Then open Notepad or any other text editor and paste the contents from the clipboard. But if you need to print the directory list\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"get directory listing - sysexporter","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/10\/dir-list-sysexporter.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/10\/dir-list-sysexporter.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/10\/dir-list-sysexporter.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/10\/dir-list-sysexporter.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1071,"url":"https:\/\/www.winhelponline.com\/blog\/run-program-elevated-right-click-menu-windows\/","url_meta":{"origin":906,"position":1},"title":"How to Add a Right-Click Menu Option to Run a Program Elevated","author":"Ramesh","date":"August 18, 2010","format":false,"excerpt":"From the Windows Taskbar, you can start a program elevated by holding the Ctrl & Shift keys and then clicking on a pinned shortcut. To launch a program elevated from the right-click menu, you can add custom entries and launch it using a script or using the NirCmd utility. Earlier\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"take ownership right-click menu","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/09\/take_ownership_context_menu.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":8738,"url":"https:\/\/www.winhelponline.com\/blog\/open-with-notepad-plus-right-click-menu-windows\/","url_meta":{"origin":906,"position":2},"title":"Add &#8220;Open with Notepad++&#8221; to the Right-Click Menu","author":"Ramesh","date":"April 19, 2019","format":false,"excerpt":"Many users have replaced Notepad with Notepad++ as the default text editor on their computers. Others use Notepad++ only when needed, and launch it via the Open with menu and choose Notepad++ from the list of options. This post tells you how to add the Open with Notepad++ command to\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"Notepad++ right-click menu in Windows","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/04\/open-with-notepad-plus-registry-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":985,"url":"https:\/\/www.winhelponline.com\/blog\/add-uac-shield-icon-right-click-context-menu-windows-7\/","url_meta":{"origin":906,"position":3},"title":"How to Add UAC Shield Icon for a Right-Click Menu Item in Windows","author":"Ramesh","date":"January 26, 2010","format":false,"excerpt":"Most users customize the right-click menu by adding additional verbs in the registry in order to launch programs or scripts. Windows 7 (and higher) lets you add the UAC Shield icon for static context menu items. If a verb you add to the right-click menu launches a program which runs\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":295,"url":"https:\/\/www.winhelponline.com\/blog\/create-shortcuts-to-eject-and-close-cddvd-drive\/","url_meta":{"origin":906,"position":4},"title":"Shortcuts to Eject and Close CD\/DVD Drive in Windows","author":"Ramesh","date":"May 23, 2008","format":false,"excerpt":"Windows already includes the Eject command in the context menu for optical drives. If you want to add the Close Tray option in the context menu for optical drives, then this article is for you. NirCmd is a small command-line tool that allows you to do some useful tasks without\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/openclosetray.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":75,"url":"https:\/\/www.winhelponline.com\/blog\/save-and-restore-desktop-icon-layout\/","url_meta":{"origin":906,"position":5},"title":"How to Save and Restore Desktop Icon Layout Automatically in Windows","author":"Ramesh","date":"March 14, 2008","format":false,"excerpt":"When testing various display resolutions or after completing a remote desktop session, the desktop icons may go out of order. Another case is that when you accidentally use the Ctrl+ Scroll button (mouse) on your desktop, the Desktop icon size changes.\u00a0But reverting to the original icon size may not restore\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"desktop icon layout desktopok","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/03\/desktop-ok-save-icon-layout.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/03\/desktop-ok-save-icon-layout.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/03\/desktop-ok-save-icon-layout.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=906"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/906\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=906"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=906"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}