Home  >  Article  >  How to always open command prompt in administrative mode

How to always open command prompt in administrative mode

WBOY
WBOYforward
2023-04-13 13:43:122280browse

We all use the command prompt in our daily work to execute commands, download, install applications, etc. Few tasks require opening the command prompt in administrative mode as it will have full permissions to successfully execute the command. So we follow the step by step process like enter cmd in the search bar and once it appears right click on it and click on run as administrator. This process takes a little time and can also be frustrating if the user needs to use the command prompt in administrator mode multiple times a day. Normally, when we use the terminal, it will be opened in the current user mode, which has restricted permissions for some execution commands. There is a solution to this problem, so let us discuss in this article how to run Command Prompt in Administrator mode by default.

How to set the command prompt to always run in administrator mode

We can open the command prompt and run in administrator mode through different methods. Follow any of these methods.

Method 1: Use the Command Prompt Shortcut

If you always use the Command Prompt in Administrator mode, follow this method as we will set the Command Prompt to be in Admin mode Run in operator mode until we restore settings.

Step 1: Open File Explorer using the key ( Windows E ), then copy the following lines and paste them into the address bar middle.

C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows System

How to always open command prompt in administrative mode

Step 2: This lists shortcuts for all applications, find the Command Prompt shortcut. Right click on it and click Properties. If you don't have a shortcut to cmd then you should create one.

How to always open command prompt in administrative mode

Step 3: Under Commands, prompt Properties click the Shortcutstab. Then click on the Advanced options below.

How to always open command prompt in administrative mode

Step 4: Under Advanced Properties, click the checkbox Run as administrator. Then click OK.

How to always open command prompt in administrative mode

Step 5: Now, when you open the command prompt, it will be in Administrator mode. And before opening the command prompt window, it will ask for confirmation to make changes to the application, so click Yes.

How to always open command prompt in administrative mode

Method 2: Change settings in the Registry Editor

Step 1: By typing # in the Windows search bar ##regedit.exeOpen Registry Editor and click on it. A pop-up window will appear asking if you want to allow changes, click Yes.

How to always open command prompt in administrative mode

Step 2 : Navigate to the following path or Copy the following path and Paste itGo to the address bar of the Registry Editor. You will find the layer folder

计算机\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

How to always open command prompt in administrative mode

Step 3: After entering the layer folder, right click Click on it, then click New in the list. Then click String value. Name it C:\Windows\System32\cmd.exe, this is the path where cmd.exe is located. If you put it in a different location, please give its full path.

How to always open command prompt in administrative mode

Step 4: Right-click on the name you created now and click Modify to add value. Enter RUNASADMIN in the numerical data and click OK.

How to always open command prompt in administrative mode

When completed, the name and data will look like this.

How to always open command prompt in administrative mode

Step 5: Now, when you open the command prompt, it will use administrator mode.

Method 3: Use the shortcut key

Type

cmd in the Windows search bar and click Ctrl Shift Enter## at the same time #key. This will bring up a window asking if you need permission to make changes to the application. Click Yes. Now the command prompt will open in administrator mode.

The above is the detailed content of How to always open command prompt in administrative mode. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yundongfang.com. If there is any infringement, please contact admin@php.cn delete