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