[Guide] Different Ways to Open Command Prompt as Administrator in Windows

Many times we need to open Command Prompt window as Administrator in Windows which is also called as “Elevated Command Prompt” window. By default when you launch a Command Prompt window, it opens in a restricted mode i.e. some advanced commands can’t be executed in this mode. It happens to prevent accidental execution of some advanced commands which can interact with Windows boot loader, etc.

But there are situations when you might need to open Command Prompt window as Administrator so that you can execute those restricted commands such as enabling hidden Administrator account in Windows, fixing Windows 7 boot screen, etc.

Today in this tutorial, we are going to share some easy ways to quickly launch Command Prompt window as Administrator. There are methods available for almost all Windows versions including Windows XP, Vista, Windows 7, Windows 8/8.1 and Windows 10.

Advertisement

So without wasting time lets start the tutorial:

1. Open Command Prompt as Administrator from Start Menu

1. Click on Start button or Start ORB and go to All programs -> Accessories.

2. Now right-click on Command Prompt shortcut and select “Run as Administrator” option.

Open_Command_Prompt_as_Administrator_Using_Start_Menu.png

You can do the same for any Command Prompt shortcut whether its pinned to Start Menu, Taskbar or placed at Desktop.

2. Open Command Prompt as Administrator using Start Menu Search

1. Click on Start button and type cmd. It’ll show cmd.exe in search results.

Open_Command_Prompt_as_Administrator_Using_Start_Menu_Search.png

Advertisement

2. Don’t click on the shortcut. Press and hold Ctrl and Shift keys and then press Enter. It’ll open Command Prompt with Administrator privileges.

Related: [Windows 10 Secret Tip] Open Programs as Administrator Using RUN Dialog Box

3. Open Command Prompt as Administrator using “Win+X” Menu

Windows 8 and Windows 10 come with some other easier methods to launch Command Prompt window as Administrator. One of them is using the new “Win+X” menu which can be accessed either by right-clicking on bottom-left corner of screen or by pressing Win+X keys together.

Open_Command_Prompt_as_Administrator_Using_Win_X_Menu.png

This menu contains a direct shortcut to launch Command Prompt as Administrator.

Related: [Tip] Restore Command Prompt Shortcut in Win+X Menu in Windows 10

4. Open Command Prompt as Administrator using Start Screen

This is another method to open Command Prompt as Administrator in Windows 8 and later. We all know that Microsoft has replaced Start Menu with new Start Screen in Windows 8. We can launch Command Prompt as Administrator using this new Start Screen as well.

1. Go to Start Screen in Windows 8 by pressing Win key and then type cmd.

2. Windows will show Command Prompt in search results page. Right-click on the shortcut and select “Run as administrator” option given at the bottom.

Run_Command_Prompt_As_Administrator_Windows_8.png

5. Open Command Prompt as Administrator using Windows Explorer

Windows 8 and Windows 10 Explorer comes with Office 2010 style Ribbon UI and Microsoft has added an option to launch Command Prompt in this ribbon.

1. Open Windows Explorer and go to a drive or folder.

2. Now click on File menu present in the ribbon and select “Open command prompt -> Open command prompt as administrator” option.

Windows_8_Explorer_Ribbon_File_Menu.png

6. Open Command Prompt as Administrator using Secret Task Manager Trick

This method works in all Windows versions. Its a hidden feature of Windows which allows you to launch Command Prompt with Administrator privileges using Task Manager.

Check out following tutorial to learn more about this secret feature:

Hidden Secret Trick to Open “Command Prompt” Window Using Task Manager

7. Always Open Command Prompt as Administrator

If you want to always open Command Prompt window as Administrator, you can follow these simple steps:

1. Right-click on Command Prompt shortcut and select Properties.

2. Now click on “Advanced” button present in “Shortcut” tab.

3. Enable “Run as administrator” option and apply the changes.

Open_Command_Prompt_as_Administrator.png

4. That’s it. Now Command Prompt window will always open with Administrator privileges.

PS: If you want, you can enable hidden built-in Administrator account in Windows and then you’ll always have Administrator privileges for all tasks:

How to Enable / Activate Hidden Administrator Account in Windows?

That’s it. These are the different ways to open Command Prompt as Administrator in Windows. If you know about any other method, feel free to share it in your comment…

Published in: Windows 10, Windows 7, Windows 8, Windows Vista, Windows XP

About the author: Vishal Gupta (also known as VG) has been awarded with Microsoft MVP (Most Valuable Professional) award. He holds Masters degree in Computer Applications (MCA). He has written several tech articles for popular newspapers and magazines and has also appeared in tech shows on various TV channels.

Comments

NOTE: Older comments have been removed to reduce database overhead.

  1. Hi VG is there a way we can have multiple runas items in registry.

    Like have Folder\shell\runas
    and
    Directory\shell\runas

    But command in the Folder key take precedence over and right click only shows the command in Folder key.

  2. hi!

    I wanna ask that can I pass domain user ID and Password to call and exe with domain admin right on limited acess user account.

    It like Run As Administrator option in windows. But I dont wanna user interaction to put user id and password.

    Regards!
    Mukesh

  3. so my gramps was on his computer yesterday and it just shut down. he restarted it and came to find out that his password for his admin account is not working. i have no idea how to fix it. i can’t run anything as an admin

  4. Hey VG,
    So I like method 7. Always Open Command Prompt as Administrator.
    Now how to bypass UAC prompt without turning it off? Is it possible?
    Thanks!

  5. Hi VG…
    The first link is what I was looking for! Thanks so much for your nice and helpful advices as always!

  6. Just an addendum to this command prompt problem.
    The Shift + Right Click or even File, command prompt does not work if the user is actually in the Library Folders. I originally thought I had a bug in Win 8 until I navigated down through the tree to the real file location. As a 40 year + veteran of computers it still makes me wonder why the ‘Libraries’ were introduced at all. I have come unstuck a few times trying to do something commonplace only to discover those actions don’t apply to ‘Libraries”

  7. i ma trying to know my pc details through cmd. i have typed systeminfo in command application but every time same thing display like ‘systeminfo is not recognized as an internal or external command.
    kindly help me asap.
    kindly send me a mail for this solution.

  8. Your instructions are no help at all. I used #2 above for Windows 7, but you give no clue as to what I do next once the administrator box appears. What the hell do I do then???

  9. I have forgotten my administrator password, now I want to remove it but I am stuck nobody can do that. Please guide me

  10. Hello VG…
    please how i can open CMD from BIOS ’cause i’ve deleted my Windows 8 partition and i’ve faced a problem in installing Windows 7
    Plzzzzzzzzzzz help me

  11. ^^ You cant open CMD from BIOS but you can boot using Windows setup disc or USB drive and then you can access Command Prompt.

  12. Thanks for replying VG 🙂 …
    yeah by holding Shift+F10 in the opening of the setup BUT that’s Command prompt and i need to access to ” Command Prompt Administrator privileges ”
    Please any help …

  13. Yep you’re so right….i’ve fixed the problem….thank u so much for your help VG
    i really apperciate that…thanks alooooooooot !!

  14. hi, please i need help.i have a toshiba laptop and just upgraded to windows 10.I need something to enter into the administrator command prompt dialogue box.Please can you give me.Thank you

  15. I am having one issue with running a command prompt as administrator and cannot seem to find an answer. I have startup scripts that run when I log in (batch files in Startup folder). When I open a command prompt normally, everything from my startup scripts has already happened. But if I right click and select run as administrator, nothing from my startup scripts has occurred.

    For example, suppose one of the things my startup script does is mount a drive T. When I open a command prompt and type T:, it goes to the T drive. When I open a command prompt and type T: it says “The system cannot find the drive specified”. I have tried everything I can find and nothing works other than manually triggering the scripts (either by typing the command or by creating a shortcut with as admin and the /k to execute the script).

    Note that once I login and open a command prompt as administrator and manually force the scripts to run I am able to close the command prompt and later open it again without needing to manually do this again. It appears that the startup scripts run for my user when I log in but are not also applied to the elevated version of my user on startup.

    Is there an automated way to make all of my startup scripts not only apply to my user but also to my user with elevated privs so that when I open a command prompt as administrator the first time after rebooting all of my startup scripts have already run?

    I am by no means a Windows expert, so I apologize if the answer is obvious. I am used to a WinXP environment and am not familiar with these aspects of Windows.

    Thanks in advance for any advice.

  16. ^^ Did you try to enable the option “Run as Administrator” in batch script shortcut’s properties?

  17. But how can I have a batch script to run cmd or any other program as admin, and which will work in all other PCs???

  18. Right click Winlogon.exe process in Task Manager -> Services and choose “Perform Administrative Tasks”.

    Now Control -> New Task or New Task -> cmd -> Enter opens Command Prompt in administrative mode.

    There is no other way.

  19. I have locked my pc up so bad that I ran system recovery now I have to start my pc with a power on pass word than it tells me that it cant reinstall windows because it is locked in safe mode I can get back to command prompt but it needs my administrator pass word put in every pass word I know but thay are all incorrect any help would be great !!!

  20. Stick this at the beginning of your cmd or batch file and it will pop up the UAC box and you just click ok and away you go. I do not take credit for creating this…only for finding it 😉

    REM –> Check for permissions
    >nul 2>&1 “%SYSTEMROOT%\system32\cacls.exe” “%SYSTEMROOT%\system32\config\system”
    REM –> If error flag set, we do not have admin.
    if ‘%errorlevel%’ NEQ ‘0’ (
    echo Requesting administrative privileges…
    goto UACPrompt
    ) else ( goto gotAdmin )
    :UACPrompt
    echo Set UAC = CreateObject^(“Shell.Application”^) > “%temp%\getadmin.vbs”
    echo UAC.ShellExecute “%~s0”, “”, “”, “runas”, 1 >> “%temp%\getadmin.vbs”
    “%temp%\getadmin.vbs”
    exit /B
    :gotAdmin
    if exist “%temp%\getadmin.vbs” ( del “%temp%\getadmin.vbs” )
    pushd “%CD%”
    CD /D “%~dp0”

  21. Hi VG,

    I sent you a post about being unable to remove Favorites from Nav Pane. I made a mistake in what I sent you (2nd key was HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder in documentation)

    However, later I read about Hidden Administrator Account. I temporarily enabled that and was able to fix the registry keys like a charm.

    So, thanks for that one too….
    Anne

  22. Hi VG,

    I sent you a post about being unable to remove Favorites from Nav Pane. I made a mistake in what I sent you (2nd key was HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder in documentation)

    However, later I read about Hidden Administrator Account. I temporarily enabled that and was able to fix the registry keys like a charm.

    So, thanks for that one too….
    Anne

    P.S. “Run List” (MRU???) is not working in Win7. Any way to enable it?

Leave a Comment

Your email address will not be published. Required fields are marked *

NOTE: Your comment may not appear immediately. It'll become visible once we approve it.