If you want to run a profile as an administrator in Windows Terminal on a Windows 11/10 computer, then this post will be helpful. Whether you want to use Windows Terminal to open PowerShell profile, Azure Cloud Shell, Command Prompt, or any other profile with admin rights, you can do this using a built-in option of Windows Terminal. Apart from that, you can also run all profiles as an administrator in Windows Terminal. This post covers both options separately.
How to run a Profile as Administrator in Windows Terminal
This option lets you select which profile can be run as administrator in Windows Terminal. Here are the steps:
- Open Windows Terminal using the WinX menu of Windows 11/10, Search box, or some other way
- Press Ctrl+, hotkey or click on the Settings option available in the drop-down icon of Windows Terminal
- When the Settings tab is opened, select a Profile from the Profiles section
- Use the toggle available for Run this profile as Administrator
- Press the Save button.
Now whenever you will run that profile, it will always open in an Admin terminal window. If the current window is not running as admin, it will open the profile in a new window.
In the same way, you can also run any other profile or all the profiles as an administrator in Windows Terminal.
Run all profiles as Administrator in Windows Terminal
There are a couple of ways to run all the profiles as an administrator in Windows Terminal. These are:
- Using Windows Terminal Settings
- By running Windows Terminal as Administrator.
1] Using Windows Terminal Settings
- Open Windows Terminal
- Use Ctrl+, hotkey to access Windows Terminal Settings
- Click on the Defaults option. It is present under the Profiles section on the left side
- Turn on the Run this profile as Administrator button.
The settings defined by you under Defaults are applied to all profiles unless you change settings for a profile separately. Thus, when you turn on this Run this profile as Administrator option, it is turned on for all the available profiles automatically. If you want, you can turn off this option for any profile separately.
2] By running Windows Terminal as Administrator
There are multiple ways to open Windows Terminal as an administrator. For example, you can right-click on the Start button of Windows 11/10, and then click on Windows Terminal (Admin) option. After that, any profile opened by you in that Admin Terminal window will run as administrator. Even if the option to Run this profile as Administrator is turned off for a particular or all profiles, those profiles will run as administrator.
How do I run as an administrator in Terminal?
If you want to run a profile as an administrator in Windows Terminal, then you can use the Run this profile as Administrator option. This option is available for each individual profile separately under the Windows Terminal Settings. Apart from that, you can also access the Defaults section under Settings and enable the associated setting to run all profiles as an administrator. This post above covers both options with step-by-step instructions.
How do I add a profile to Windows Terminal?
To add a new profile in Windows Terminal, follow these steps:
- Use Ctrl+, hotkey to open Windows Terminal Settings
- Click on the Add a new profile option from the left section
- Click on the New empty profile button
- Set options for the profile like name, executable used in the profile, tab title, etc.
- Press the Save button.
Hope it helps.