Add or Remove 'Open in Windows Terminal as administrator' context menu  

Page 1 of 2 12 LastLast
    Add or Remove 'Open in Windows Terminal as administrator' context menu

    Add or Remove 'Open in Windows Terminal as administrator' context menu

    How to Add or Remove "Open in Windows Terminal as administrator" context menu in Windows 10
    Published by Category: Customization
    26 May 2021
    Designer Media Ltd


    How to Add or Remove "Open in Windows Terminal as administrator" context menu in Windows 10


    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.

    Starting with Windows 10 build 21337, Windows Terminal is now an inbox app.

    Windows 10 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 10.

    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.

    The "Open in Windows Terminal as administrator" context menu will not work and give an error when you right click on the root background of a drive.


    EXAMPLE: "Open in Windows Terminal as administrator" context menu
    Add or Remove 'Open in Windows Terminal as administrator' context menu-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




  1. Posts : 403
    Win7 Pro X64, Win10 Pro x640
       #1

    @Brink

    The PowerShell Admin prompt doesn't launch a shell window. I think the command needs to be modified.
      My Computer

  2. Brink's Avatar
    Posts : 57,701
    64-bit Windows 10 Pro for Workstations build 21390
    Thread Starter
       #2

    bamajon1974 said:
    @Brink

    The PowerShell Admin prompt doesn't launch a shell window. I think the command needs to be modified.
    Hello,

    Just to verify, do you have the Windows Terminal app installed?

    Which build of Windows 10 do you have installed?
      My Computers


  3. Posts : 403
    Win7 Pro X64, Win10 Pro x640
       #3

    Brink said:
    Hello,

    Just to verify, do you have the Windows Terminal app installed?

    Which build of Windows 10 do you have installed?
    Correct. I have terminal installed. The command prompt option works, but not PowerShell option.

    Running 20H2 version.
      My Computer

  4. Brink's Avatar
    Posts : 57,701
    64-bit Windows 10 Pro for Workstations build 21390
    Thread Starter
       #4

    bamajon1974 said:
    Correct. I have terminal installed. The command prompt option works, but not PowerShell option.

    Running 20H2 version.
    Hmm, the PowerShell option is working if you right click on a folder, but not for the folder background.

    I'll have to do some testing to see why.

    For now the default and command prompt options work on the background. The default is normally Windows PowerShell that can be used for now.
      My Computers

  5. Brink's Avatar
    Posts : 57,701
    64-bit Windows 10 Pro for Workstations build 21390
    Thread Starter
       #5

    @bamajon1974,

    Found the issue. There was a typo in the command. I have updated the .reg downloads. It should work now for you after merging the new .reg version.
      My Computers


  6. Posts : 403
    Win7 Pro X64, Win10 Pro x640
       #6

    Great. I will try out the modified reg file this evening.

    Thanks!
      My Computer

  7. Brink's Avatar
    Posts : 57,701
    64-bit Windows 10 Pro for Workstations build 21390
    Thread Starter
       #7

    bamajon1974 said:
    Great. I will try out the modified reg file this evening.

    Thanks!


    Please let me know how it went.
      My Computers


  8. Posts : 403
    Win7 Pro X64, Win10 Pro x640
       #8

    Brink said:


    Please let me know how it went.
    The modification works! Thank you!

    What do you need to modify the "Windows Powershell" part of the code to launch PowerShell v7 as well?
    @="powershell.exe -WindowStyle Hidden "Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-p','"""Windows PowerShell"""','-d','"""%1"""')""

    Also, what is the Azure Cloud Shell Option? I am not familiar with that shell.

    Thanks!
      My Computer

  9. Brink's Avatar
    Posts : 57,701
    64-bit Windows 10 Pro for Workstations build 21390
    Thread Starter
       #9

    bamajon1974 said:
    The modification works! Thank you!

    What do you need to modify the "Windows Powershell" part of the code to launch PowerShell v7 as well?
    @="powershell.exe -WindowStyle Hidden "Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-p','"""Windows PowerShell"""','-d','"""%1"""')""

    Also, what is the Azure Cloud Shell Option? I am not familiar with that shell.

    Thanks!
    You're most welcome.

    Using this below opened PowerShell v7 for me.

    @="powershell.exe -WindowStyle Hidden "Start-Process -Verb RunAs cmd.exe -ArgumentList @('/c','start wt.exe','-p','"""PowerShell"""','-d','"""%1"""')""

    The Azure Cloud Shell option is for this below:

    https://docs.microsoft.com/en-us/azu...shell/overview
      My Computers


 
Page 1 of 2 12 LastLast

Tutorial Categories

Add or Remove 'Open in Windows Terminal as administrator' context menu Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 05:15.
Find Us




Windows 10 Forums