Skip to content

Instantly share code, notes, and snippets.

@fernandofig
Created February 15, 2023 02:35
Show Gist options
  • Save fernandofig/74a0ad8bdf3179da2fa13fd7e8737c9f to your computer and use it in GitHub Desktop.
Save fernandofig/74a0ad8bdf3179da2fa13fd7e8737c9f to your computer and use it in GitHub Desktop.
Registry hack to create Explorer context menus that launch Windows Terminal on the selected folder. Requires Windows Terminal installed!
Windows Registry Editor Version 5.00
; This cleanup stuff usually fails due to restrictive permissions on these keys on the registry
; I'm leaving them here anyway for reference so you can set ownership to these keys for
; yourself, and then deleting them should work.
;
; Cleanup default context menu entries
[-HKEY_CLASSES_ROOT\Drive\shell\cmd]
[-HKEY_CLASSES_ROOT\Drive\shell\Powershell]
[-HKEY_CLASSES_ROOT\Drive\shell\WSL]
[-HKEY_CLASSES_ROOT\Directory\shell\cmd]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\cmd]
[-HKEY_CLASSES_ROOT\Directory\shell\powershellmenu]
[-HKEY_CLASSES_ROOT\Directory\shell\Powershell]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\powershellmenu]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Powershell]
[-HKEY_CLASSES_ROOT\Directory\shell\WSL]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\WSL]
; Cleanup old menu entries
[-HKEY_CLASSES_ROOT\Directory\shell\MSYS]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\MSYS]
[-HKEY_CLASSES_ROOT\Directory\shell\01MenuCmd]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\01MenuCmd]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd]
[-HKEY_CLASSES_ROOT\Directory\shell\02MenuPowerShell]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\02MenuPowerShell]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell]
[-HKEY_CLASSES_ROOT\Directory\shell\03MenuMSYS]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\03MenuMSYS]
[-HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuMSYS]
; ATTENTION BELOW! YOUR'RE SUPPOSED TO CHANGE THE PROFILE NAME ON EACH OCCURRENCE
; OF wt.exe -p \"...\", CHANGING THE '...' FOR WHATEVER PROFILE NAME YOU HAVE
; CONFIGURED ON WINDOWS TERMINAL FOR THE GIVEN SHELL!
; Command Prompt
[HKEY_CLASSES_ROOT\Directory\shell\cmd]
"MUIVerb"="Terminal: Command Prompt"
"Extended"=""
"Icon"="cmd.exe"
"NoWorkingDirectory"=""
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
@="wt.exe -p \"Command Prompt\" -d \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd]
"MUIVerb"="Terminal: Command Prompt"
"Extended"=""
"Icon"="cmd.exe"
"NoWorkingDirectory"=""
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd\command]
@="wt.exe -p \"Command Prompt\" -d \"%V\""
; PowerShell
[HKEY_CLASSES_ROOT\Directory\shell\PowerShell]
"MUIVerb"="Terminal: PowerShell"
"Extended"=""
"Icon"="C:\\\\Program Files\\\\PowerShell\\\\7\\\\pwsh.exe"
"NoWorkingDirectory"=""
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\Directory\shell\PowerShell\command]
@="wt.exe -p \"PowerShell\" -d \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\PowerShell]
"MUIVerb"="Terminal: PowerShell"
"Extended"=""
"Icon"="C:\\\\Program Files\\\\PowerShell\\\\7\\\\pwsh.exe"
"NoWorkingDirectory"=""
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\Directory\Background\shell\PowerShell\command]
@="wt.exe -p \"PowerShell\" -d \"%V\""
; MSYS
[HKEY_CLASSES_ROOT\Directory\shell\MSYS]
"MUIVerb"="Terminal: MSYS"
"Extended"=""
"Icon"="C:\\\\MSYS\\\\msys2.ico"
"NoWorkingDirectory"=""
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\Directory\shell\MSYS\command]
@="wt.exe -p \"UCRT64 / MSYS2\" -d \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\MSYS]
"MUIVerb"="Terminal: MSYS"
"Extended"=""
"Icon"="C:\\\\MSYS\\\\msys2.ico"
"NoWorkingDirectory"=""
"ShowBasedOnVelocityId"=dword:00639bc8
[HKEY_CLASSES_ROOT\Directory\Background\shell\MSYS\command]
@="wt.exe -p \"UCRT64 / MSYS2\" -d \"%V\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment