How to Launch Terminal as an Administrator in Windows 11

|

|

The article discusses how to automate the Windows Terminal app to open as an admin window in Windows 11. It teaches using the app’s settings, specifically the ‘Run this profile as Administrator’ toggle. Another method discussed involves editing the app’s JSON configuration file, where adding “elevate:true” or “elevate:false” would enable or disable this feature respectively.

This article explains how to automatically open the Terminal with an administrator window in Windows 11.

Windows Terminal is a modern host application for the command-line shells, including Command PromptWindows PowerShell, and bash (via Windows Subsystem for Linux (WSL)).

Unlike the previous shell apps, Windows Terminal has many features, including multiple tabs, panes, Unicode and UTF-8 character support, a GPU-accelerated text rendering engine, and themes customization with text, colors, backgrounds, and shortcuts.

If you want to use the Terminal with administrative privileges, you can right-click on the Terminal app and select to open as Administrator.

Windows Terminal app has a setting that lets you automatically open an admin window each time you run the app.

The steps below show you how to do that.

Automatically open the Terminal app in an admin window

As described above, you can set up the Terminal app to open automatically in an admin window. In this admin window, you can run with administrator privileges without running as Administrator each time.

Here’s how to do that.

First, open the Windows Terminal app.

You can do that by clicking on the Start menu and searching for Terminal. Then, under Best match, select and open the Windows Terminal app.

When the Terminal app opens, click the down arrow button on the top bar, and select Settings (Ctrl +,).

On the Settings window, under Profile, click on the Defaults tab. Then select the tile “Run this profile as Administrator,” and toggle the button to the On position to enable the Terminal app to always open in an admin window.

To disable it, toggle the button back to the Off position.

Click on the Save button to save your changes and exit.

Open the Windows Terminal automatically in an elevated window

Another way you can automatically open up the Terminal in an “elevated” window (running as Administrator) is to use its built-in JSON configuration file.

To do that, follow the steps below.

Select the Open JSON file button on the bottom left.

When the file opens, location the highlighted section.

To turn on or off opening the Terminal app in an elevated window, add the line below to the exact area of the configuration file.

Disable:

"elevate":false,

Add the line at the exact location in the file and save.

        "defaults": 
        {
            "elevate": false
        },

Enable:

"elevate":true,

Add the line to the exact location in the configuration file.

        "defaults": 
        {
            "elevate": true
        },

Save the JSON configuration file to apply your changes.

That should do it!

Reference:

https://learn.microsoft.com/en-us/windows/terminal/

Conclusion:

This post showed you how to enable or disable the Terminal app opening in an elevated window in Windows 11. If you find any errors above or have something to add, please use the comment form below.

Like this:



8 responses to “How to Launch Terminal as an Administrator in Windows 11”

  1. Learn how to list services that are running or stopped in Windows 11 - Geek Rewind

    […] open Windows Terminal and select the PowerShell […]

  2. Here’s how you can check the size of Reserved Storage in Windows 11 - Geek Rewind

    […] open the Windows Terminal app as […]

  3. Learn how to reset Local Security Policy settings to their defaults in Windows 11 - Geek Rewind

    […] First, open the Windows Terminal app as administrator. […]

  4. Here’s how to make a local printer accessible to other devices on your network in Windows 11 - Geek Rewind

    […] open the Windows Terminal app as administrator and select the PowerShell […]

  5. How to Fix or Restore WSL Ubuntu Linux on Windows 11 WSL - Geek Rewind

    […] the Windows Terminal app can reset WSL Ubuntu […]

  6. A Guide to Restoring the Widgets Function on Windows 11 - Geek Rewind

    […] do that, first, open the Windows Terminal app as an administrator. Then, you can use either the Windows PowerShell or Command Prompt […]

  7. Steps for Resetting Windows Search on Windows 11 - Geek Rewind

    […] open Windows Terminal as administrator, and select Windows PowerShell or Command […]

  8. How to List User Profiles and Accounts in Windows 11 - Geek Rewind

    […] open the Windows Terminal app and select the PowerShell […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.