{"id":1520,"date":"2007-03-05T19:19:02","date_gmt":"2007-03-05T13:49:02","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=1520"},"modified":"2022-07-13T23:07:44","modified_gmt":"2022-07-13T17:37:44","slug":"open-elevated-command-prompt-windows","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/open-elevated-command-prompt-windows\/","title":{"rendered":"How to Open Elevated or Admin Command Prompt in Windows?"},"content":{"rendered":"<p>Command Prompt is one of the most used tools in Windows. For tasks requiring administrator privileges, we need to start Command Prompt as administrator (&#8220;elevated&#8221;). This article describes different ways to open an elevated or administrator Command Prompt window.<!--more--><\/p>\n<h2>How to Open Elevated or Admin Command Prompt<\/h2>\n<h3>From the Win-X menu in Windows 11\/10 and 8.1<\/h3>\n<ul>\n<li>Press the <kbd>Win<\/kbd> + <kbd>X<\/kbd> key, or right-click the Start button.<\/li>\n<li><span style=\"font-size: inherit;\">Click <\/span><strong style=\"font-size: inherit;\">Command Prompt (Admin)<br \/>\n<img loading=\"lazy\" decoding=\"async\" style=\"font-size: inherit; font-weight: normal;\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/w10\/winxmenu-1.png\" width=\"260\" height=\"612\" \/><br \/>\n<\/strong><\/li>\n<\/ul>\n<p><em><strong>Note:<\/strong> Recent versions of Windows 10 replace Command Prompt with PowerShell in the <kbd>Win<\/kbd> + <kbd>X<\/kbd> menu. To get Command Prompt back in the menu, see the article <a href=\"https:\/\/www.winhelponline.com\/blog\/cmd-here-windows-10-context-menu-add\/\">Get back &#8220;Open command window here&#8221; context menu option in Windows 10<\/a><\/em><\/p>\n<h3>Using Ctrl + Shift + Enter in Windows 10 and 11<\/h3>\n<ol>\n<li>Right-click Start, and click Run.<\/li>\n<li>Type <code>cmd.exe<\/code> in the Run dialog<\/li>\n<li>Press <kbd>Ctrl<\/kbd> + <kbd>Shift<\/kbd> and <kbd>Enter<\/kbd>.<\/li>\n<\/ol>\n<p>This launches a Command Prompt window as an administrator.<\/p>\n<p><em>RELATED: <a href=\"https:\/\/www.winhelponline.com\/blog\/run-command-elevated-administrator-ctrl-shift-enter-windows-10\/\">Start Programs Elevated (as Administrator) from Run Dialog in Windows 10 [Ctrl + Shift]<\/a><\/em><\/p>\n<h3>Using Start Search<\/h3>\n<ol>\n<li>Click Start, type <strong>cmd<\/strong>.<strong>exe<\/strong><\/li>\n<li>When the search results are shown, right-click the <strong>cmd.exe<\/strong> entry and choose <strong>Run as administrator<\/strong>.<br \/>\n<em>Alternately, select the cmd.exe in the search results using the UP\/DOWN arrow and press <kbd>Ctrl<\/kbd> + <kbd>Shift<\/kbd> + <kbd>Enter<\/kbd> on the keyboard. <kbd>Ctrl<\/kbd> + <kbd>Shift<\/kbd> + <kbd>Enter<\/kbd> runs the program as administrator.<\/em><\/li>\n<\/ol>\n<h3>Using Task Manager &#8211; New task<\/h3>\n<ol>\n<li>Right-click on the taskbar and click Task Manager. Or, press <kbd>Ctrl<\/kbd> + <kbd>Shift<\/kbd> and <kbd>Esc<\/kbd><\/li>\n<li>In Task Manager, click the File menu and click <strong>Run new task<\/strong><\/li>\n<li>Type <code>cmd.exe<\/code> in the text box.<\/li>\n<li>Enable <strong>Create this task with administrative privileges<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8845\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/taskmgr-cmd-elevated.png\" alt=\"task manager -run command prompt elevated - create new task\" width=\"700\" height=\"326\" \/><br \/>\n<\/strong><\/li>\n<li>Click OK.<\/li>\n<\/ol>\n<p><em>The Task Manager method offers an advantage. In Windows 10, as Task Manager runs as administrator by default, it doesn&#8217;t show you the UAC prompt when you launch a program using it from an administrator account.<\/em><\/p>\n<h3>Run as administrator using Shortcut Properties<\/h3>\n<p>Click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator. You can even pin the Command Prompt shortcut to the taskbar for easy reach.<\/p>\n<p>Or you can create a new desktop shortcut to <strong>cmd.exe<\/strong>. Right-click on the shortcut and choose <strong>Run as administrator<\/strong>. To run the shortcut as an administrator by default:<\/p>\n<ol>\n<li>Right-click the Command Prompt shortcut you created on the Desktop<\/li>\n<li>Click <strong>Properties<\/strong><\/li>\n<li>In the <strong>Shortcut<\/strong> tab, click <strong>Advanced<\/strong>.<\/li>\n<li>Enable the checkbox for <strong>Run as administrator<\/strong><\/li>\n<li>Click <strong>OK<\/strong> and <strong>OK<\/strong>.<\/li>\n<\/ol>\n<p>Now, every time when you double-click the shortcut Command Prompt window will open elevated.<\/p>\n<p>If you&#8217;re a frequent user of the Command Prompt, you can <strong>Pin<\/strong> it to the Start menu or Taskbar.<\/p>\n<h3>Run as Administrator via the folder and desktop right-click menu<\/h3>\n<p>To add the <strong>Open Command Window Here (Administrator)<\/strong> option to the right-click menu for folders and the Desktop, use the following .reg file:<\/p>\n<pre><code>Windows Registry Editor Version 5.00\r\n\r\n[HKEY_CLASSES_ROOT\\Directory\\shell\\runas]\r\n@=\"Open Command Window Here (Administrator)\"\r\n\r\n[HKEY_CLASSES_ROOT\\Directory\\shell\\runas\\command]\r\n@=\"cmd.exe \/s \/k pushd \\\"%V\\\"\"\r\n\r\n[HKEY_CLASSES_ROOT\\directory\\Background\\Shell\\runas]\r\n@=\"Open Command Window Here (Administrator)\"\r\n\r\n[HKEY_CLASSES_ROOT\\directory\\Background\\Shell\\runas\\command]\r\n@=\"cmd.exe \/s \/k pushd \\\"%V\\\"\"\r\n\r\n<\/code><\/pre>\n<p>To add the entry to <b>This PC<\/b> (<i>Computer<\/i>) context menu, use the following REG file:<\/p>\n<pre><code>Windows Registry Editor Version 5.00\r\n\r\n[HKEY_CLASSES_ROOT\\CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\shell\\runas]\r\n@=\"Open Command Prompt (Administrator)\"\r\n\r\n[HKEY_CLASSES_ROOT\\CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\shell\\runas\\command]\r\n@=\"cmd.exe\"\r\n<\/code><\/pre>\n<p><em>Note that the .reg files above replace the <b>runas<\/b> command in the registry if one was added manually earlier. For example, if you&#8217;ve added something like <a href=\"https:\/\/www.winhelponline.com\/blog\/take-ownership-of-file-or-folder\/\">&#8220;Take Ownership&#8221; to the right-click menu<\/a> for folders, it will be replaced by <strong>Command Prompt (Administrator)<\/strong>.<\/em><\/p>\n<h4>How to Use .reg Files<\/h4>\n<p><a href=\"https:\/\/www.winhelponline.com\/blog\/how-to-use-reg-files-registration-entries-windows\/\">Make a .reg file<\/a> out of the above contents, and double-click the .reg file and apply the settings to the registry.<\/p>\n<p>You can now open an elevated Command Prompt from the context menu of a folder, This PC or on the Desktop. It adds an <strong>Open Command Prompt here (Administrator)<\/strong> option in the context menu for folders and <strong>This PC<\/strong> (<i>Computer<\/i>) and the Desktop. Here are the screenshots:<\/p>\n<h3>Screenshots<\/h3>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-9609\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2006\/12\/cmdhere-admin.gif\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9609\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2006\/12\/mycomputer-cmd.gif\" width=\"355\" height=\"174\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9609\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/elevcmd-desktop.jpg\" alt=\"open elevated command prompt desktop\" width=\"340\" height=\"231\" \/><\/p>\n<figure id=\"attachment_9609\" aria-describedby=\"caption-attachment-9609\" style=\"width: 287px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9609 size-full\" src=\"https:\/\/www.winhelponline.com\/articles\/content_images\/cmd_elevated.gif\" alt=\"\" width=\"297\" height=\"95\" \/><figcaption id=\"caption-attachment-9609\" class=\"wp-caption-text\">Elevated Command Prompt<\/figcaption><\/figure>\n<figure id=\"attachment_9609\" aria-describedby=\"caption-attachment-9609\" style=\"width: 287px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-9609 size-full\" src=\"https:\/\/www.winhelponline.com\/articles\/content_images\/cmd_normal.gif\" alt=\"\" width=\"297\" height=\"95\" \/><figcaption id=\"caption-attachment-9609\" class=\"wp-caption-text\">Regular Command Prompt<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Command Prompt is one of the most used tools in Windows. For tasks requiring administrator privileges, we need to start Command Prompt as administrator (&#8220;elevated&#8221;). This article describes different ways to open an elevated or administrator Command Prompt window.<\/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":[106,441],"class_list":["post-1520","post","type-post","status-publish","format-standard","hentry","category-windows","tag-command-prompt","tag-registry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":59323,"url":"https:\/\/www.winhelponline.com\/blog\/sfc-must-be-administrator-console-session\/","url_meta":{"origin":1520,"position":0},"title":"[SFC] You must be an administrator running a console session","author":"Ramesh","date":"July 11, 2023","format":false,"excerpt":"When you try to run Sfc.exe \/scannow on Command Prompt to repair the system files, the following error message may appear: You must be an administrator running a console session in order to use the sfc utility. This may happen even though you right-click Command Prompt from the Start menu\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":"task manager -run command prompt elevated - create new task","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/taskmgr-cmd-elevated.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/taskmgr-cmd-elevated.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/taskmgr-cmd-elevated.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/taskmgr-cmd-elevated.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":277,"url":"https:\/\/www.winhelponline.com\/blog\/mapped-drives-not-seen-elevated-command-prompt-task-scheduler\/","url_meta":{"origin":1520,"position":1},"title":"Mapped drives not seen from elevated Command Prompt and Task Scheduler","author":"Ramesh","date":"May 12, 2008","format":false,"excerpt":"When you attempt to access a mapped network drive from an elevated or admin Command Prompt or Task Scheduler (with the highest privileges), the mapped drive won't be available. Attempting to use the mapped network drives causes the error The system cannot find the path specified (Error code: 0x80070003). Here\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"mapped network drive not seen from admin command prompt and task scheduler","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/05\/mapped-drives-enablelinkedconnections.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/05\/mapped-drives-enablelinkedconnections.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/05\/mapped-drives-enablelinkedconnections.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":4837,"url":"https:\/\/www.winhelponline.com\/blog\/remove-open-powershell-window-here-rightclick-windows-10\/","url_meta":{"origin":1520,"position":2},"title":"Remove Open PowerShell window here from Right-Click Menu in Windows 10","author":"Ramesh","date":"December 15, 2016","format":false,"excerpt":"With the Windows 10 Creators Update, the context menu option \"Open command window here\" is hidden by default, and is replaced by the \"Open PowerShell window here\" entry. Not just that. PowerShell replaces Command Prompt in the Win+X (Power User) menu as well. In an earlier post, we saw how\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":"add cmd here to right-click menu","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/command-prompt-context-windows-10.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/command-prompt-context-windows-10.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/command-prompt-context-windows-10.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/12\/command-prompt-context-windows-10.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1632,"url":"https:\/\/www.winhelponline.com\/blog\/run-as-administrator-does-not-work-windows\/","url_meta":{"origin":1520,"position":3},"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":24381,"url":"https:\/\/www.winhelponline.com\/blog\/add-open-command-window-here-menu-windows-11\/","url_meta":{"origin":1520,"position":4},"title":"How to Add &#8220;Open command window here&#8221; in Windows 11","author":"Ramesh","date":"October 10, 2021","format":false,"excerpt":"In Windows 11, the context menu \"Open Command window here\" doesn't exist by default. Instead, you'll see the \"Open in Windows Terminal\" and \"Open PowerShell window here\" (when you press Shift + right-click) options in the folder context menu. This article tells you how to add \"Open Command window here\"\u2026","rel":"","context":"In &quot;Windows 11&quot;","block_context":{"text":"Windows 11","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-11\/"},"img":{"alt_text":"windows terminal option in win+x start context menu","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2021\/10\/win-x-terminal-powershell-comd.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":1520,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/1520","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=1520"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/1520\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=1520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=1520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=1520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}