Personalization Add "Open in Terminal (Admin)" context menu in Windows 11


Windows_Terminal_Admin_banner.png

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

Windows Terminal is a modern host application for the command-line shells you already love, like Command Prompt, PowerShell, and bash (via Windows Subsystem for Linux (WSL)). Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and the ability to create your own themes and customize text, colors, backgrounds, and shortcuts.

Windows 11 includes a Open in 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).

The Open in Terminal (Admin) context menu will allow you to select to open an elevated Windows Terminal to the current folder path with the default 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 Terminal (Admin)" context menu.



EXAMPLE: "Open in Terminal (Admin)" context menu

You will need to click/tap on Show more options first by default, then click/tap on Open in Terminal (Admin).


Show_more_options.webp
Open_in_Terminal_Admin_context_menu.webp
Expandable_Open_in_Terminal_Admin_context_menu.webp




Here's How:

1 Do step 2 (add-expandable), step 3 (add), or step 4 (add) below for what you would like to do.

2 Add Expandable Right Click "Open in Terminal (Admin)" Context Menu

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

Add_expandable_Open_in_Terminal_admin


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 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]

[HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin]
"HasLUAShield"=""
"MUIVerb"="Open in Terminal (Admin)"
"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]
@="conhost --headless powershell -C $p=@{Verb='RunAs'}; saps wt @p -a '-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]
@="conhost --headless powershell -C $p=@{Verb='RunAs'}; saps wt @p -a '-p \"\"\"Windows PowerShell\"\"\" -d \"\"\"%V\\.\"\"\"'"

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

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHereAsAdmin]
"HasLUAShield"=""
"MUIVerb"="Open in Terminal (Admin)"
"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]
@="conhost --headless powershell -C $p=@{Verb='RunAs'}; saps wt @p -a '-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]
@="conhost --headless powershell -C $p=@{Verb='RunAs'}; saps wt @p -a '-p \"\"\"Windows PowerShell\"\"\" -d \"\"\"%V\\.\"\"\"'"


3 Add "Open in Terminal (Admin)" Context Menu

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

Add_Open_in_Terminal_admin.reg


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

[-HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin]

[HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin]
"HasLUAShield"=""
"MUIVerb"="Open in Terminal (Admin)"
"Extended"=-

[HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin\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]

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHereAsAdmin]
"HasLUAShield"=""
"MUIVerb"="Open in Terminal (Admin)"
"Extended"=-

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


3 Remove "Open in Terminal (Admin)" 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_Terminal_admin.reg


(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

Last edited:
@garlin
Hmm your code is a bit advance for me but something like this?
Code:
@="conhost --headless powershell -WindowStyle Hidden \"Start-Process $p=@{Verb='RunAs'}; cmd.exe -A @('/c','start wt.exe','-p','\"\"\"Command Prompt\"\"\"','-d','\"\"\"%V\\.\"\"\"')\""
 

My Computer My Computer

At a glance

Windows 11 ProIntel i7 9700k OC 5.0ghz32gb Gskill 3200mhz OC 3600mhzNvidia RTX 4070 Super FE
OS
Windows 11 Pro
Computer type
PC/Desktop
Manufacturer/Model
Self built
CPU
Intel i7 9700k OC 5.0ghz
Motherboard
Gigabyte Z390 Master, Rev1.0, F13f GF
Memory
32gb Gskill 3200mhz OC 3600mhz
Graphics Card(s)
Nvidia RTX 4070 Super FE
Sound Card
Onboard ESS Saber
Monitor(s) Displays
QHD LG 27" 165hz, OC 180hz, Asus 27" 144hz
Screen Resolution
2k
Hard Drives
Nvme SSD Samsung 990 Pro 2TB, 970 echo plus 1tb + 970 echo 256gb.
PSU
EVGA SuperNova platinum 800w
Case
NZXT H500 sweat box, modified.
Cooling
NZXT Kraken x63.
Keyboard
Logitech G810
Mouse
Logitech G403
Internet Speed
1.1gb down 110mb up
1. The point is to obfuscate the command, otherwise Defender has an easy rule match to block all "powershell -Verb RunAs" lines from a context menu. By breaking up the command into two halves, it takes a more advanced rule to figure out it's the same command.

2. There's no need to pass the ArgumentList as an array, that's just more work without any real benefits. Defender isn't blocking a command based on the ArgumentList. You're adding more random single quotes and commas than it's worth.

Code:
@="conhost --headless powershell -C $p=@{Verb='RunAs'}; saps wt @p -a '-p \"\"\"Command Prompt\"\"\" -d \"\"\"%V\\.\"\"\"'"
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
@garlin
I get it now, so something like this.

Code:
Windows Registry Editor Version 5.00

; Created by: Garlin & Treble TA removing the submenus from the default.
; Created on: (14/09/2026)
; Tutorial: https://www.elevenforum.com/t/add-open-in-windows-terminal-as-administrator-context-menu-in-windows-11.581/


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

[HKEY_CLASSES_ROOT\Directory\Shell\001flyout\command]
@="conhost --headless powershell -C $p=@{Verb='RunAs'}; saps wt @p -a '-p \"\"\"Command Prompt\"\"\" -d \"\"\"%V\\.\"\"\"'"

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

[HKEY_CLASSES_ROOT\Directory\Shell\002flyout\command]
@="conhost --headless powershell -C $p=@{Verb='RunAs'}; saps wt @p -a '-p \"\"\"Windows PowerShell\"\"\" -d \"\"\"%V\\.\"\"\"'"

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

[HKEY_CLASSES_ROOT\Directory\Background\Shell\001flyout\command]
@="conhost --headless powershell -C $p=@{Verb='RunAs'}; saps wt @p -a '-p \"\"\"Command Prompt\"\"\" -d \"\"\"%V\\.\"\"\"'"

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

[HKEY_CLASSES_ROOT\Directory\Background\Shell\002flyout\command]
@="conhost --headless powershell -C $p=@{Verb='RunAs'}; saps wt @p -a '-p \"\"\"Windows PowerShell\"\"\" -d \"\"\"%V\\.\"\"\"'"

The saps (start Process) wt (windows term), Thanks you, it works perfectly :)


P.S to remove

Code:
Windows Registry Editor Version 5.00
; Created by: By Treble TA
; Created on: (14/09/2026 by TrebleTA)
; Tutorial: https://www.elevenforum.com/t/add-open-in-windows-terminal-as-administrator-context-menu-in-windows-11.581/

[-HKEY_CLASSES_ROOT\Directory\shell\001flyout]
[-HKEY_CLASSES_ROOT\Directory\shell\002flyout]

[-HKEY_CLASSES_ROOT\Directory\Background\shell\001flyout]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\002flyout]

1789349379261.webp
 
Last edited:

My Computer My Computer

At a glance

Windows 11 ProIntel i7 9700k OC 5.0ghz32gb Gskill 3200mhz OC 3600mhzNvidia RTX 4070 Super FE
OS
Windows 11 Pro
Computer type
PC/Desktop
Manufacturer/Model
Self built
CPU
Intel i7 9700k OC 5.0ghz
Motherboard
Gigabyte Z390 Master, Rev1.0, F13f GF
Memory
32gb Gskill 3200mhz OC 3600mhz
Graphics Card(s)
Nvidia RTX 4070 Super FE
Sound Card
Onboard ESS Saber
Monitor(s) Displays
QHD LG 27" 165hz, OC 180hz, Asus 27" 144hz
Screen Resolution
2k
Hard Drives
Nvme SSD Samsung 990 Pro 2TB, 970 echo plus 1tb + 970 echo 256gb.
PSU
EVGA SuperNova platinum 800w
Case
NZXT H500 sweat box, modified.
Cooling
NZXT Kraken x63.
Keyboard
Logitech G810
Mouse
Logitech G403
Internet Speed
1.1gb down 110mb up
1. The point is to obfuscate the command, otherwise Defender has an easy rule match to block all "powershell -Verb RunAs" lines from a context menu. By breaking up the command into two halves, it takes a more advanced rule to figure out it's the same command.

2. There's no need to pass the ArgumentList as an array, that's just more work without any real benefits. Defender isn't blocking a command based on the ArgumentList. You're adding more random single quotes and commas than it's worth.

Code:
@="conhost --headless powershell -C $p=@{Verb='RunAs'}; saps wt @p -a '-p \"\"\"Command Prompt\"\"\" -d \"\"\"%V\\.\"\"\"'"

Thank you Garlin. This command works great.

@TrebleTA the tutorial has been updated to add this back as step 2 to make it easy.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro for WorkstationsIntel i7-8700K 5 GHz64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600...ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GD...
    OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Amazon Basics Wired Full Keyboard MD005
    Mouse
    Logitech MX Master 4
    Internet Speed
    2 Gbps Download and 100 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • At a glance

    Windows 11 ProSnapdragon X Elite (12 core) 3.42 GHz16 GB LPDDR5x-7467 MHz
    Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
Worked for me...

[HKEY_CLASSES_ROOT\Directory\shell\OpenWTHere]
@="Open in Windows Terminal"
"Icon"="wt.exe"

[HKEY_CLASSES_ROOT\Directory\shell\OpenWTHere\command]
@="wt -d \"%1\""
 

My Computer My Computer

At a glance

Windows 11 Pro 25H2
OS
Windows 11 Pro 25H2
Computer type
Laptop
Manufacturer/Model
Toshiba
Hmm noticed the cmd prompt icon has like a person not a admin shield. Will sort later.
 

My Computer My Computer

At a glance

Windows 11 ProIntel i7 9700k OC 5.0ghz32gb Gskill 3200mhz OC 3600mhzNvidia RTX 4070 Super FE
OS
Windows 11 Pro
Computer type
PC/Desktop
Manufacturer/Model
Self built
CPU
Intel i7 9700k OC 5.0ghz
Motherboard
Gigabyte Z390 Master, Rev1.0, F13f GF
Memory
32gb Gskill 3200mhz OC 3600mhz
Graphics Card(s)
Nvidia RTX 4070 Super FE
Sound Card
Onboard ESS Saber
Monitor(s) Displays
QHD LG 27" 165hz, OC 180hz, Asus 27" 144hz
Screen Resolution
2k
Hard Drives
Nvme SSD Samsung 990 Pro 2TB, 970 echo plus 1tb + 970 echo 256gb.
PSU
EVGA SuperNova platinum 800w
Case
NZXT H500 sweat box, modified.
Cooling
NZXT Kraken x63.
Keyboard
Logitech G810
Mouse
Logitech G403
Internet Speed
1.1gb down 110mb up
Worked for me...

[HKEY_CLASSES_ROOT\Directory\shell\OpenWTHere]
@="Open in Windows Terminal"
"Icon"="wt.exe"

[HKEY_CLASSES_ROOT\Directory\shell\OpenWTHere\command]
@="wt -d \"%1\""
But you're not Admin :rolleyes:
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
I might be missing something...

Terminal is set to default open as Administrator.

My account is Administrator.
 

My Computer My Computer

At a glance

Windows 11 Pro 25H2
OS
Windows 11 Pro 25H2
Computer type
Laptop
Manufacturer/Model
Toshiba
Back
Top Bottom