{"id":1071,"date":"2010-08-18T18:25:46","date_gmt":"2010-08-18T12:55:46","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=1071"},"modified":"2020-11-28T04:58:09","modified_gmt":"2020-11-28T04:58:09","slug":"run-program-elevated-right-click-menu-windows","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/run-program-elevated-right-click-menu-windows\/","title":{"rendered":"How to Add a Right-Click Menu Option to Run a Program Elevated"},"content":{"rendered":"<p>From the Windows Taskbar, you can start a program elevated by holding the Ctrl &amp; 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 we wrote about the new <a href=\"https:\/\/www.winhelponline.com\/blog\/nircmd-elevate-switch-useful-uses\/\">elevate<\/a> command-line argument in <a href=\"http:\/\/www.nirsoft.net\/utils\/nircmd.html\" target=\"_blank\" rel=\"noopener noreferrer\">NirCmd<\/a>, which you can implement in the context menu.<\/p>\n<p>This article tells you how to add a right-click menu option to run a program elevated.<\/p>\n<p><!--more--><\/p>\n<h2>Example: Add &#8220;Notepad (Administrator)&#8221; Option to the Context Menu<\/h2>\n<ol>\n<li>Click Start, type <code>regedit.exe<\/code> and go to:\n<pre>HKEY_CLASSES_ROOT\\*\\shell<\/pre>\n<\/li>\n<li>Create a subkey named <code>Notepad<\/code><\/li>\n<li>Select Notepad, double-click the <code>(default)<\/code> value and set &#8220;<code>Notepad (Administrator)<\/code>&#8221; as the data<\/li>\n<li>Create a string value named <code>HasLUAShield<br \/>\n<\/code><em>(This adds the UAC shield icon to the context menu item. <b>Ref:<\/b> <a href=\"https:\/\/www.winhelponline.com\/blog\/add-uac-shield-icon-right-click-context-menu-windows-7\/\">Add UAC Shield Icon to the Right-Click Menu<\/a>)<\/em><\/li>\n<li>Create a string value named <b>Extended<br \/>\n<img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived\/w7-elev-rc-menu-2.png\" \/><br \/>\n<\/b><\/li>\n<li>Under the <code>Notepad<\/code> key, create another subkey named <code>Command<\/code><\/li>\n<li>\n<pre>Select <code>Command<\/code>, and type in the following value data for <code>(default)\r\n<\/code>\"C:\\Windows\\System32\\nircmd.exe\" elevate notepad.exe \"%1\"<\/pre>\n<p><em>(Assuming that you&#8217;ve copied NirCmd.exe to the Windows\\System32 directory.)<br \/>\n<img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived\/w7-elev-rc-menu-1.png\" \/><br \/>\n<\/em><\/li>\n<li>Exit the Registry Editor.<\/li>\n<\/ol>\n<p>Press and hold the Shift key down, right-click on a file (say, the <strong>HOSTS<\/strong> file) that you want to edit using Notepad under elevated privileges, and then click <b>Notepad (Administrator)<\/b><\/p>\n<p><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived\/w7-elev-rc-menu-3.png\" \/><\/p>\n<h2>Other Possible Uses<\/h2>\n<p>Register and Unregister DLLs from the Right-click menu. (<a href=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived\/register-dll.zip\">REG file<\/a>)<\/p>\n<p><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived\/w7-elev-rc-menu-5.png\" \/><\/p>\n<p>Open an elevated Command Prompt window from the Desktop context menu. (<a href=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived\/cmd-admin.zip\">REG file<\/a>)<\/p>\n<p><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived\/w7-elev-rc-menu-4.png\" \/><\/p>\n<p>Take Ownership of a file or folder from the context menu. (<a href=\"https:\/\/www.winhelponline.com\/blog\/take-ownership-via-right-click-context-menu-add\/\">REG file<\/a>)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4022 alignnone\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/09\/take_ownership_context_menu.png\" alt=\"take ownership right-click menu\" width=\"380\" height=\"571\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>From the Windows Taskbar, you can start a program elevated by holding the Ctrl &amp; 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 we wrote about the new &#8230; <a title=\"How to Add a Right-Click Menu Option to Run a Program Elevated\" class=\"read-more\" href=\"https:\/\/www.winhelponline.com\/blog\/run-program-elevated-right-click-menu-windows\/\" aria-label=\"Read more about How to Add a Right-Click Menu Option to Run a Program Elevated\">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_memberships_contains_paid_content":false,"footnotes":""},"categories":[7],"tags":[441],"class_list":["post-1071","post","type-post","status-publish","format-standard","hentry","category-windows","tag-registry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":5410,"url":"https:\/\/www.winhelponline.com\/blog\/run-command-elevated-administrator-ctrl-shift-enter-windows-10\/","url_meta":{"origin":1071,"position":0},"title":"Start Programs Elevated (as Administrator) from Run Dialog in Windows 10 [Ctrl + Shift]","author":"Ramesh","date":"September 15, 2017","format":false,"excerpt":"If you want to edit your HOSTS file or any file that requires admin privileges to edit, you need to open Notepad or your preferred text editor as administrator.\u00a0To start a program elevated, you usually right-click on the shortcut and click Run as Administrator from the context menu. Alternately, you\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"start menu elevate program ctrl shift","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/09\/run-elevated-3.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":127,"url":"https:\/\/www.winhelponline.com\/blog\/adding-the-run-as-administrator-option-for-vbs-and-js-files\/","url_meta":{"origin":1071,"position":1},"title":"Add Run as Administrator Context Menu Item for VBS and JS files","author":"Ramesh","date":"March 27, 2008","format":false,"excerpt":"By default, Windows does not include the Run as Administrator option in the context menu for Vbscript (.VBS) and JScript (.JS) files. So, to run a script elevated, you either need to launch the script from elevated Command Prompt window, or use the VBScript self-elevation method as described in article\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"add run as administrator context menu for vbs files","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/script_runas.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1632,"url":"https:\/\/www.winhelponline.com\/blog\/run-as-administrator-does-not-work-windows\/","url_meta":{"origin":1071,"position":2},"title":"Run as Administrator Option Missing or Does Nothing; File Association Error","author":"Ramesh","date":"February 14, 2016","format":false,"excerpt":"Symptoms Case 1:\u00a0When you right-click on an executable file or a shortcut, the Run as Administrator may be missing. From Windows 10 or 11 Start menu, if you right-click a program, click More, and select Run as administrator, nothing may happen. Right-clicking Start and clicking Command Prompt (Admin) or PowerShell\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"runasadmin legacydisable error","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/02\/runasadmin-legacydisable-error-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/02\/runasadmin-legacydisable-error-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/02\/runasadmin-legacydisable-error-1.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1006,"url":"https:\/\/www.winhelponline.com\/blog\/nircmd-elevate-switch-useful-uses\/","url_meta":{"origin":1071,"position":3},"title":"NirCmd Elevate Switch Added &#8211; Some Useful Uses","author":"Ramesh","date":"February 24, 2010","format":false,"excerpt":"We've covered the excellent multi-purpose command-line tool NirCmd from Nirsoft earlier. This post talks about the new command-line switches added in the current version of NirCmd. Earlier this month, I sent a NirCmd feature request to Nir Sofer, asking to include an \"elevate\" switch, which should launch an application elevated\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1954,"url":"https:\/\/www.winhelponline.com\/blog\/associate-autocad-script-scr-notepad-screen-saver\/","url_meta":{"origin":1071,"position":4},"title":"How to Associate AutoCAD Script (.SCR) Files With Notepad?","author":"Ramesh","date":"March 9, 2016","format":false,"excerpt":"AutoCAD Script files and Windows Screen Savers, both use .SCR file extension. If you're trying to change the .SCR file type association to edit your AutoCAD scripts with Notepad or any other editor, you'll note that the Open With... right-click menu option isn't available for .SCR files. That's because they're\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\/w10\/autocad-scr.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":1071,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/1071","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=1071"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/1071\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=1071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=1071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=1071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}