Home > Common Problem > How to always open command prompt in administrative mode

How to always open command prompt in administrative mode

WBOY
Release: 2023-04-13 13:43:12
forward
2301 people have browsed it

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
Copy after login

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
Copy after login

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!

Related labels:
source:yundongfang.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template