How often do you need to run the Command Prompt, PowerShell, or Windows Terminal as administrator on your Windows 11/10? For me what happens is, I often forget to right-click and select Run as administrator and I know it only when I get the error in running any command as shown in the screenshot below. And trust me it annoys me too much go back and open it again with the administrator privileges.
You must be an administrator running a console session in order to use the sfc utility.
Well, in today’s post, we will learn how to always run Command Prompt, PowerShell, or Windows Terminall as administrator.
We will create desktop shortcuts to make Command Prompt and PowerShell run as administrators every time we open it. For Terminal, we will change a setting.
How to always run Command Prompt as Administrator
You have two options to always run an elevated CMD.
1] Create an elevated Desktop Shortcut For Command Prompt
To create a shortcut for Command Prompt, go to the Desktop.
- Right-click on the desktop > New > New Shortcut.
- Type cmd.exe in the box. Finish the shortcut wizard and you will see a Command Prompt shortcut on your desktop.
- Once created, right-click on the shortcut and go to Properties.
- Click on Advanced and it will open a new pop-up window.
- Check the box saying, “Run as administrator”
- Click OK and then Apply.
Now you can open Command Prompt with just a single click. While you can disable UAC – it is not recommended at all as it could put your computer at a security risk.
2] Change Advanced properties of CMD.exe
If you don’t want to create a shortcut for Command Prompt on your desktop, you can just change the Properties of CMD.exe and pin it to your taskbar.
- Click on the Windows icon on your screen and Type cmd
- Click on Open File Location.
- Right-click on Command Prompt (cmd.exe) and go to the Properties.
- Click on the Advanced tab and check the box saying, “Run as administrator”
- Click on OK then Apply and then again OK.
Go to Start again and type CMD
Click on Pin to taskbar and you are done.
You will get a Command Prompt shortcut in your taskbar and it will always run with the administrative privileges.
How to Always Run PowerShell as an Administrator
You again have two options to always run an elevated PowerShell prompt.
1] Create a desktop shortcut
Just as we did for Command Prompt, you can do the same with PowerShell as well. We will create a PowerShell shortcut on our desktop and make it run always with administrator privileges.
To create a shortcut for PowerShell on the desktop, go to the Desktop.
- Right-click > New >Shortcut.
- Type PowerShell in the box in the pop-up window.
- Finish the wizard and you will a PowerShell icon on your desktop.
- Right-click on the PowerShell icon and click on Properties.
- Go to Advanced and check the box saying, “Run and administrator”
- Click Ok then Apply and again Ok.
2] Change Advanced properties of powershell.exe
Same as we did with Command Prompt above, type PowerShell in your Windows Search box and open the file location.
Right-click on PowerShell > Properties > Advanced.
Check the box saying, “Run and administrator”
Click OK then Apply and again OK.
Open PowerShell from your Search Box again and click on Pin to taskbar.
You are done.
You will now see a PowerShell icon in your taskbar and every time you click it you can open PowerShell with the administrator privileges.
How to Always Run Terminal as Administrator
To always run Terminal as an administrator follow these steps:
- Right-click the Start button to open the Win X Menu
- Select Windows Terminal
- Select the drop-down ‘arrow’ menu next to the new tab option
- Click on Settings
- On the left pane select Defaults under Profiles
- On the right side, turn on Run this profile as Administrator.
Hope this helps.