How to always open command prompt in administrative mode
Apr 13, 2023 pm 01:43 PMWe 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
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.
Step 3: Under Commands, prompt Properties click the Shortcutstab. Then click on the Advanced options below.
Step 4: Under Advanced Properties, click the checkbox Run as administrator. Then click OK.
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.
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.
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
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.
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.
Step 5: Now, when you open the command prompt, it will use administrator mode.
Method 3: Use the shortcut key Typecmd 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!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to run a JAR file on Windows 11 or 10

How to install CAB files on Windows 11

How to fix the problem in Valorant that requires a system restart before playing?

How to fix application error 0xc0000906 on Windows PC

How to quickly resolve Windows activation error code 0xc004c020?

How to safely set high priority for apps in Windows 11?

How to fix srttrail.txt on Windows 11

3 Ways to Open System 32 Folder on Windows 11 or 10