How To Run Cmd As Administrator On Windows 10

Run as administrator feature is very important on windows, it protects your Windows OS from security risks. This article will tell you how to run cmd as administrator both in graphical user interface and command line. The method can be used to run PowerShell as administrator and other windows programs also.

1. Run As Administrator From Start Menu.

  1. In windows 10, expand Windows System folder from Start menu, then right-click Command Prompt (dos cmd window), click More —> Run as administrator menu item. Click Yes in the next popup User Account Control dialog, now it will open the Command Prompt window with administrator privileges.
    windows-10-startup-cmd-run as administrator

2.Run As Administrator From Windows Explorer.

  1. Click Open file location menu item in the above example, then it will open the Command Prompt program saved directory in a windows explorer.
  2. Right-click the Command Prompt shortcut, then click Run as administrator menu item in the popup menu list.
    right click window program - click run as administrator - menu item

3.Run As Administrator From Command-Line.

  1. Open a terminal and run command runas /user:Administrator “windows-program-path”.
    runas /user:Administrator "C:\Java\jdk1.8.0_231\bin\java"
    Enter the password for Administrator:
    Attempting to start C:\Java\jdk1.8.0_231\bin\java as user "DESKTOP-Q26A5F3\Administrator" ...
    RUNAS ERROR: Unable to run - C:\Java\jdk1.8.0_231\bin\java
    1326: The user name or password is incorrect.
    
  2. Whatever password you input, you may encounter the above error which said The user name or password is incorrect. This is because the Windows Administrator account is disabled by default, you need to enable it and set a password for it before using it.
  3. If you want to run the Windows program with another user account, just use the other user’s name to replace name Administrator in command runas /user:Administrator “windows-program-path” like below.
    runas /user:Jerry "C:\Java\jdk1.8.0_231\bin\java"

4. Always Run A Program As Administrator.

  1. If you want to run a Windows program with administrator privileges for every time, you can follow below steps.
  2. Right-click the Windows program executable file in Windows Explorer.
  3. Click the Properties menu item at the end of the popup menu list.
  4. In the pop-up dialog, click the Compatibility tab, then check the Run this program as administrator checkbox at the bottom of the dialog.
    windows-program-properties-compatbility-run as administrator
  5. Click the OK and Apply button to save the changes.
  6. Now when you run it each time, it will popup the User Account Control dialog and run it with administrator privileges.

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.