Skip to content

Instantly share code, notes, and snippets.

@OmegaRogue
Last active June 24, 2024 10:52
Show Gist options
  • Save OmegaRogue/9069405e7b0bf5e76f1c5d9c96f8b663 to your computer and use it in GitHub Desktop.
Save OmegaRogue/9069405e7b0bf5e76f1c5d9c96f8b663 to your computer and use it in GitHub Desktop.
Registry script to add windows terminal with cmd, powershell and ubuntu profiles to the explorer context menu with normal and admin permissions. To use, replace <Username> with your username
Windows Registry Editor Version 5.00
; Windows terminal
[HKEY_CLASSES_ROOT\Directory\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminal"
[HKEY_CLASSES_ROOT\Directory\background\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminal"
[HKEY_CLASSES_ROOT\Directory\LibraryFolder\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminal"
[HKEY_CLASSES_ROOT\Drive\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminal"
[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminal"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\CMD\shell\open]
"Icon"="imageres.dll,-5323"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\CMD\shell\open\command]
@="C:\\Users\\<Username>\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe -p \"cmd\" -d ."
[HKEY_CLASSES_ROOT\Directory\ContextMenus\CMD\shell\runas]
"HasLUAShield"=""
"MUIVerb"="Sudo"
"Icon"="imageres.dll,-5324"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\CMD\shell\runas\command]
@="cmd.exe /s /c pushd \"%V\" & start wt -p \"cmd\" -d ."
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\CMD]
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\CMD"
"Icon"="imageres.dll,-5323"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Powershell]
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\Powershell"
"Icon"="imageres.dll,-5372"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Ubuntu]
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\Ubuntu"
"Icon"="C:\\Program Files\\WindowsApps\\CanonicalGroupLimited.UbuntuonWindows_2004.2020.424.0_x64__79rhkp1fndgsc\\ubuntu.exe"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\Powershell\shell\open]
"Icon"="imageres.dll,-5372"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\Powershell\shell\open\command]
@="C:\\Users\\<Username>\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe -p \"Windows PowerShell\" -d ."
[HKEY_CLASSES_ROOT\Directory\ContextMenus\Powershell\shell\runas]
"HasLUAShield"=""
"MUIVerb"="Sudo"
"Icon"="imageres.dll,-5373"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\Powershell\shell\runas\command]
@="cmd.exe /s /c pushd \"%V\" & start wt -p \"Windows PowerShell\" -d ."
[HKEY_CLASSES_ROOT\Directory\ContextMenus\Ubuntu\shell\open]
"Icon"="C:\\Program Files\\WindowsApps\\CanonicalGroupLimited.UbuntuonWindows_2004.2020.424.0_x64__79rhkp1fndgsc\\ubuntu.exe"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\Ubuntu\shell\open\command]
@="C:\\Users\\<Username>\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe -p \"Ubuntu\" -d ."
[HKEY_CLASSES_ROOT\Directory\ContextMenus\Ubuntu\shell\runas]
"HasLUAShield"=""
"MUIVerb"="Sudo"
"Icon"="C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_2004.2020.424.0_x64__79rhkp1fndgsc\ubuntu.exe"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\Ubuntu\shell\runas\command]
@="cmd.exe /s /c pushd \"%V\" & start wt -p \"Ubuntu\" -d ."
Windows Registry Editor Version 5.00
; Windows terminal
[HKEY_CLASSES_ROOT\Directory\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminal"
[HKEY_CLASSES_ROOT\Directory\background\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminal"
[HKEY_CLASSES_ROOT\Directory\LibraryFolder\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminal"
[HKEY_CLASSES_ROOT\Drive\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminal"
[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminal"
; Windows Terminal SUDO
[HKEY_CLASSES_ROOT\Directory\shell\MenuWindowsTerminalSudo]
"MUIVerb"="Windows Terminal (Admin)"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminalSudo"
[HKEY_CLASSES_ROOT\Directory\background\shell\MenuWindowsTerminalSudo]
"MUIVerb"="Windows Terminal (Admin)"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminalSudo"
[HKEY_CLASSES_ROOT\Directory\LibraryFolder\shell\MenuWindowsTerminalSudo]
"MUIVerb"="Windows Terminal (Admin)"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminalSudo"
[HKEY_CLASSES_ROOT\Drive\shell\MenuWindowsTerminalSudo]
"MUIVerb"="Windows Terminal (Admin)"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminalSudo"
[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\MenuWindowsTerminalSudo]
"MUIVerb"="Windows Terminal (Admin)"
"Icon"="C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\\ContextMenus\\MenuWindowsTerminalSudo"
; Subcommands
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\CMD]
"MUIVerb"="CMD"
"ExtendedSubCommandsKey"=-
"Icon"="imageres.dll,-5323"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\CMD\command]
@="C:\\Users\\<Username>\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe -p \"Command Prompt\" -d ."
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Powershell]
"MUIVerb"="Windows PowerShell"
"ExtendedSubCommandsKey"=-
"Icon"="imageres.dll,-5372"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Powershell\command]
@="C:\\Users\\<Username>\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe -p \"Windows PowerShell\" -d ."
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Ubuntu]
"MUIVerb"="Ubuntu"
"ExtendedSubCommandsKey"=-
"Icon"="C:\\Program Files\\WindowsApps\\CanonicalGroupLimited.UbuntuonWindows_2004.2020.424.0_x64__79rhkp1fndgsc\\ubuntu.exe"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Ubuntu\command]
@="C:\\Users\\<Username>\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe -p \"Ubuntu\" -d ."
; Subcommands Sudo
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\CMD]
"MUIVerb"="CMD"
"HasLUAShield"=""
"Icon"="imageres.dll,-5324"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\CMD]
@="cmd.exe /s /c pushd \"%V\" & start wt -p \"Command Prompt\" -d ."
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Powershell]
"MUIVerb"="Windows PowerShell"
"HasLUAShield"=""
"Icon"="imageres.dll,-5373"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Powershell\command]
@="cmd.exe /s /c pushd \"%V\" & start wt -p \"Windows PowerShell\" -d ."
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Ubuntu]
"MUIVerb"="Ubuntu"
"HasLUAShield"=""
"Icon"="C:\\Program Files\\WindowsApps\\CanonicalGroupLimited.UbuntuonWindows_2004.2020.424.0_x64__79rhkp1fndgsc\\ubuntu.exe"
[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Ubuntu\command]
@="cmd.exe /s /c pushd \"%V\" & start wt -p \"Ubuntu\" -d ."
Windows Registry Editor Version 5.00
; Windows terminal
[-HKEY_CLASSES_ROOT\Directory\shell\MenuWindowsTerminal]
[-HKEY_CLASSES_ROOT\Directory\background\shell\MenuWindowsTerminal]
[-HKEY_CLASSES_ROOT\Directory\LibraryFolder\shell\MenuWindowsTerminal]
[-HKEY_CLASSES_ROOT\Drive\shell\MenuWindowsTerminal]
[-HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\MenuWindowsTerminal]
; Windows Terminal SUDO
[-HKEY_CLASSES_ROOT\Directory\shell\MenuWindowsTerminalSudo]
[-HKEY_CLASSES_ROOT\Directory\background\shell\MenuWindowsTerminalSudo]
[-HKEY_CLASSES_ROOT\Directory\LibraryFolder\shell\MenuWindowsTerminalSudo]
[-HKEY_CLASSES_ROOT\Drive\shell\MenuWindowsTerminalSudo]
[-HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\MenuWindowsTerminalSudo]
; Subcommands
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\CMD]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\CMD\command]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Powershell]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Powershell\command]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Ubuntu]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Ubuntu\command]
; Subcommands Sudo
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\CMD]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\CMD]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Powershell]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Powershell\command]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Ubuntu]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Ubuntu\command]
[-HKEY_CLASSES_ROOT\Directory\shell\MenuWindowsTerminal]
[-HKEY_CLASSES_ROOT\Directory\LibraryFolder\shell\MenuWindowsTerminal]
[-HKEY_CLASSES_ROOT\Drive\shell\MenuWindowsTerminal]
[-HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\MenuWindowsTerminal]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\CMD\shell\open]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\CMD\shell\open\command]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\CMD\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\CMD\shell\runas\command]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Powershell]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Ubuntu]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\Powershell\shell\open]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\Powershell\shell\open\command]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\Powershell\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\Powershell\shell\runas\command]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\Ubuntu\shell\open]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\Ubuntu\shell\open\command]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\Ubuntu\shell\runas]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\Ubuntu\shell\runas\command]
@t-makaro
Copy link

t-makaro commented Apr 7, 2020

The admin powershell command doesn't appear at launch as admin. I was having this problem then I tried creating my .reg file. Also, the admin cmd command doesn't appear to open anything. I don't have WSL set up so I can't test that one.

@Whale-fall
Copy link

can not show the icon of ubuntu correctly

@lingr7
Copy link

lingr7 commented Apr 29, 2020

can not show the icon of wt_32.ico correctly
总的图标

can not show the icon of ubuntu correctly
图标显示不正常

@edex96
Copy link

edex96 commented Apr 30, 2020

@lingr7 @Whale-fall
Its because the icon file location is version dependent you need to change it accordingly the text for me is
Microsoft.WindowsTerminal_0.11.1191.0_x64__8wekyb3d8bbwe

you can resolve as ..

cd C:\Program Files\WindowsApps\
ctrl + f 'Microsoft.WindowsTerminal'
select & copy the name
replace all with the new name

Once the app is in public release I hope it'll have a fixed folder

@lingr7
Copy link

lingr7 commented May 1, 2020

Thank you.Fxi it by your method.It is OK now.
@Whale-fall The ubuntu icon is the same problem. the name modify.Change the name accordingly.And Change the name accordingly
一个
image

@cikichen
Copy link

cikichen commented May 2, 2020

sudo needs runas

@AsishRaju
Copy link

@OmegaRogue can you also add a remove.reg to remove the context menu from registry. just in case someone wants it.

@antgustech
Copy link

Seeing that v1 is now released on the store, what should the filepath be for the executable?

@ihordyrman
Copy link

Looks like it needs to update since new version comes

@carcinogoy
Copy link

New path should be Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe

@antgustech
Copy link

antgustech commented May 21, 2020

I updated the script like this:

`Windows Registry Editor Version 5.00

; Windows terminal

[HKEY_CLASSES_ROOT\Directory\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\ContextMenus\MenuWindowsTerminal"

[HKEY_CLASSES_ROOT\Directory\background\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\ContextMenus\MenuWindowsTerminal"

[HKEY_CLASSES_ROOT\Directory\LibraryFolder\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\ContextMenus\MenuWindowsTerminal"

[HKEY_CLASSES_ROOT\Drive\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\ContextMenus\MenuWindowsTerminal"

[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\MenuWindowsTerminal]
"MUIVerb"="Windows Terminal"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\ContextMenus\MenuWindowsTerminal"

; Windows Terminal SUDO

[HKEY_CLASSES_ROOT\Directory\shell\MenuWindowsTerminalSudo]
"MUIVerb"="Windows Terminal (Admin)"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\ContextMenus\MenuWindowsTerminalSudo"

[HKEY_CLASSES_ROOT\Directory\background\shell\MenuWindowsTerminalSudo]
"MUIVerb"="Windows Terminal (Admin)"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\ContextMenus\MenuWindowsTerminalSudo"

[HKEY_CLASSES_ROOT\Directory\LibraryFolder\shell\MenuWindowsTerminalSudo]
"MUIVerb"="Windows Terminal (Admin)"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\ContextMenus\MenuWindowsTerminalSudo"

[HKEY_CLASSES_ROOT\Drive\shell\MenuWindowsTerminalSudo]
"MUIVerb"="Windows Terminal (Admin)"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\ContextMenus\MenuWindowsTerminalSudo"

[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\MenuWindowsTerminalSudo]
"MUIVerb"="Windows Terminal (Admin)"
"Icon"="C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe"
"ExtendedSubCommandsKey"="Directory\ContextMenus\MenuWindowsTerminalSudo"

; Subcommands

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\CMD]
"MUIVerb"="CMD"
"ExtendedSubCommandsKey"=-
"Icon"="imageres.dll,-5323"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\CMD\command]
@="C:\Users\\AppData\Local\Microsoft\WindowsApps\wt.exe -p "cmd" -d ."

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Powershell]
"MUIVerb"="Windows PowerShell"
"ExtendedSubCommandsKey"=-
"Icon"="imageres.dll,-5372"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Powershell\command]
@="C:\Users\\AppData\Local\Microsoft\WindowsApps\wt.exe -p "Windows PowerShell" -d ."

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Ubuntu]
"MUIVerb"="Ubuntu"
"ExtendedSubCommandsKey"=-
"Icon"="C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_1804.2020.5.0_x64__79rhkp1fndgsc\ubuntu.exe"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminal\shell\Ubuntu\command]
@="C:\Users\\AppData\Local\Microsoft\WindowsApps\wt.exe -p "Ubuntu" -d ."

; Subcommands Sudo

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\CMD]
"MUIVerb"="CMD"
"HasLUAShield"=""
"Icon"="imageres.dll,-5324"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\CMD]
@="cmd.exe /s /c pushd "%V" & start wt -p "cmd" -d ."

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Powershell]
"MUIVerb"="Windows PowerShell"
"HasLUAShield"=""
"Icon"="imageres.dll,-5373"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Powershell\command]
@="cmd.exe /s /c pushd "%V" & start wt -p "Windows PowerShell" -d ."

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Ubuntu]
"MUIVerb"="Ubuntu"
"HasLUAShield"=""
"Icon"="C:\Program Files\WindowsApps\CanonicalGroupLimited.UbuntuonWindows_1804.2020.5.0_x64__79rhkp1fndgsc\ubuntu.exe"

[HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuWindowsTerminalSudo\shell\Ubuntu\command]
@="cmd.exe /s /c pushd "%V" & start wt -p "Ubuntu" -d ."
`

It shows up in the context menu and all but nothing happens when I click any of the options of CMD, Powershell or Ubuntu in non admin. For admin, only Powershell starts.

@OmegaRogue
Copy link
Author

I updated the paths for the current versions

@OmegaRogue
Copy link
Author

@OmegaRogue can you also add a remove.reg to remove the context menu from registry. just in case someone wants it.

Added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment