Personalization Add "Open in Windows Terminal as administrator" context menu in Windows 11

  • Staff
Windows_Terminal_elevated_banner.png

Windows Terminal is included by default in Windows 11.

The Windows Terminal is a modern, fast, efficient, powerful, and productive terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and WSL. Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and custom themes, styles, and configurations.

See also: An overview on Windows Terminal

Windows 11 includes a Open in Windows Terminal context menu by default when you right click or shift + right click on a folder or folder background, but this does not open Windows Terminal elevated (run as administrator).

This tutorial will show you how to add or remove a Open in Windows Terminal as administrator context menu for all users in Windows 11.

The Open in Windows Terminal as administrator context menu will allow you to select to open an elevated Windows Terminal to the current folder path with the default shell profile, Command Prompt shell profile, or Windows PowerShell shell profile.

You must be signed in as an administrator to add, remove, and use the "Open in Windows Terminal as administrator" context menu.


EXAMPLE: "Open in Windows Terminal as administrator" context menu
Show_more_options.png
Open_in_Windows_Terminal_as_administrator.png




Here's How:

1 Do step 2 (add-right click), step 3 (add-Shift+right click) , or step 4 (remove) below for what you would like to do.


2 To Add Right Click "Open in Windows Terminal as administrator" Context Menu

A) Click/tap on the Download button below to download the file below, and go to step 5 below.

Add_Open_in_Windows_Terminal_as_administrator.reg

Download

If you installed PowerShell 7 and would like to add it to this context menu, then you can download and merge the Add_PowerShell_7_as_admin.reg file below afterwards.

Download

If you installed Ubuntu for WSL or WSL2 and would like to add Ubuntu to this context menu, then you can download and merge the Add_Ubuntu_as_admin.reg file below afterwards.

Download


(Contents of .Add_Open_in_Windows_Terminal_as_administrator.reg file for reference)
Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin]
"HasLUAShield"=""
"MUIVerb"="Open in Windows Terminal as administrator"
"Extended"=-
"SubCommands"=""

[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\001flyout]
"MUIVerb"="Default Profile"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\001flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-d','\"\"\"%V\\.\""\"\"')\""


[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\002flyout]
"MUIVerb"="Command Prompt"
"Icon"="imageres.dll,-5324"

[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\002flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-p','\"\"\"Command Prompt\"\"\"','-d','\"\"\"%V\\.\""\"\"')\""


[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\003flyout]
"MUIVerb"="PowerShell"
"HasLUAShield"=""
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\003flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-p','\"\"\"Windows PowerShell\"\"\"','-d','\"\"\"%1\\.\"\"\"')\""



[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHereAsAdmin]
"HasLUAShield"=""
"MUIVerb"="Open in Windows Terminal as administrator"
"Extended"=-
"SubCommands"=""

[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\001flyout]
"MUIVerb"="Default Profile"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\001flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-d','\"\"\"%V\\.\"\"\"')\""


[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\002flyout]
"MUIVerb"="Command Prompt"
"Icon"="imageres.dll,-5324"

[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\002flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-p','\"\"\"Command Prompt\"\"\"','-d','\"\"\"%V\\.\"\"\"')\""


[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\003flyout]
"MUIVerb"="PowerShell"
"HasLUAShield"=""
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\003flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-p','\"\"\"Windows PowerShell\"\"\"','-d','\"\"\"%V\\.\"\"\"')\""


3 To Add Shift + Right Click "Open in Windows Terminal as administrator" Context Menu

A) Click/tap on the Download button below to download the file below, and go to step 5 below.

Add_Shift+Open_in_Windows_Terminal_as_administrator.reg

Download

If you installed PowerShell 7 and would like to add it to this context menu, then you can download and merge the Add_PowerShell_7_as_admin.reg file below afterwards.

Download

If you installed Ubuntu for WSL or WSL2 and would like to add Ubuntu to this context menu, then you can download and merge the Add_Ubuntu_as_admin.reg file below afterwards.

Download


(Contents of .reg file for reference)
Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin]
"HasLUAShield"=""
"MUIVerb"="Open in Windows Terminal as administrator"
"Extended"=""
"SubCommands"=""

[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\001flyout]
"MUIVerb"="Default Profile"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\001flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-d','\"\"\"%V\\.\""\"\"')\""


[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\002flyout]
"MUIVerb"="Command Prompt"
"Icon"="imageres.dll,-5324"

[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\002flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-p','\"\"\"Command Prompt\"\"\"','-d','\"\"\"%V\\.\""\"\"')\""


[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\003flyout]
"MUIVerb"="PowerShell"
"HasLUAShield"=""
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Directory\Shell\OpenWTHereAsAdmin\shell\003flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-p','\"\"\"Windows PowerShell\"\"\"','-d','\"\"\"%1\\.\"\"\"')\""



[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHereAsAdmin]
"HasLUAShield"=""
"MUIVerb"="Open in Windows Terminal as administrator"
"Extended"=""
"SubCommands"=""

[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\001flyout]
"MUIVerb"="Default Profile"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\001flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-d','\"\"\"%V\\.\""\"\"')\""


[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\002flyout]
"MUIVerb"="Command Prompt"
"Icon"="imageres.dll,-5324"

[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\002flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-p','\"\"\"Command Prompt\"\"\"','-d','\"\"\"%V\\.\""\"\"')\""


[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\003flyout]
"MUIVerb"="PowerShell"
"HasLUAShield"=""
"Icon"="powershell.exe"

[HKEY_CLASSES_ROOT\Directory\Background\Shell\OpenWTHereAsAdmin\shell\003flyout\command]
@="powershell.exe -WindowStyle Hidden \"Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-p','\"\"\"Windows PowerShell\"\"\"','-d','\"\"\"%V\\.\""\"\"')\""


4 To Remove "Open in Windows Terminal as administrator" Context Menu

This is the default setting.


A) Click/tap on the Download button below to download the file below, and go to step 5 below.

Remove_Open_in_Windows_Terminal_as_administrator.reg

Download

(Contents of .reg file for reference)
Code:
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin]

[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHereAsAdmin]


5 Save the .reg file to your desktop.

6 Double click/tap on the downloaded .reg file to merge it.

7 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

8 You can now delete the downloaded .reg file if you like.


That's it,
Shawn Brink


 

Attachments

  • Windows_Terminal_elevated.png
    Windows_Terminal_elevated.png
    8.4 KB · Views: 26
  • Remove_Open_in_Windows_Terminal_as_administrator.reg
    344 bytes · Views: 59
  • Add_Open_in_Windows_Terminal_as_administrator.reg
    2.9 KB · Views: 2
  • Add_PowerShell_7_as_admin.reg
    1 KB · Views: 3
  • Add_Shift+Open_in_Windows_Terminal_as_administrator.reg
    2.9 KB · Views: 2
  • Add_Ubuntu_as_admin.reg
    1 KB · Views: 3
Last edited:
Top Bottom