Skip to content

Instantly share code, notes, and snippets.

@Reedbeta
Last active August 29, 2021 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Reedbeta/d5e7c89ca7f8828777b48ce3d8781e4c to your computer and use it in GitHub Desktop.
Save Reedbeta/d5e7c89ca7f8828777b48ce3d8781e4c to your computer and use it in GitHub Desktop.
Windows registry edit to add Bash and Command Prompt items to Explorer context menu - version using Windows Terminal
Windows Registry Editor Version 5.00
; Get rid of existing Windows Terminal context menu item
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked]
"{9F156763-7844-4DC4-B2B1-901F640F5155}"=""
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Bash]
@="Bash"
"Icon"=hex(2):22,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,\
00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,\
77,00,73,00,6c,00,2e,00,65,00,78,00,65,00,22,00,00,00
; REG_EXPAND_SZ "%SystemRoot%\System32\wsl.exe"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Bash\command]
@=hex(2):22,00,25,00,4c,00,6f,00,63,00,61,00,6c,00,41,00,70,00,70,00,44,00,61,\
00,74,00,61,00,25,00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,\
74,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,41,00,70,00,70,00,73,\
00,5c,00,77,00,74,00,2e,00,65,00,78,00,65,00,22,00,20,00,2d,00,70,00,20,00,\
55,00,62,00,75,00,6e,00,74,00,75,00,20,00,2d,00,64,00,20,00,22,00,25,00,56,\
00,22,00,00,00
; REG_EXPAND_SZ "%LocalAppData%\Microsoft\WindowsApps\wt.exe" -p Ubuntu -d "%V"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Command Prompt]
@="Command Prompt"
"Icon"=hex(2):22,00,25,00,43,00,6f,00,6d,00,53,00,70,00,65,00,63,00,25,00,22,\
00,00,00
; REG_EXPAND_SZ "%ComSpec%"
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Command Prompt\command]
@=hex(2):22,00,25,00,4c,00,6f,00,63,00,61,00,6c,00,41,00,70,00,70,00,44,00,61,\
00,74,00,61,00,25,00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,\
74,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,41,00,70,00,70,00,73,\
00,5c,00,77,00,74,00,2e,00,65,00,78,00,65,00,22,00,20,00,2d,00,70,00,20,00,\
22,00,43,00,6f,00,6d,00,6d,00,61,00,6e,00,64,00,20,00,50,00,72,00,6f,00,6d,\
00,70,00,74,00,22,00,20,00,2d,00,64,00,20,00,22,00,25,00,56,00,22,00,00,00
; REG_EXPAND_SZ "%LocalAppData%\Microsoft\WindowsApps\wt.exe" -p "Command Prompt" -d "%V"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Bash]
@="Bash"
"Icon"=hex(2):22,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,\
00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,\
77,00,73,00,6c,00,2e,00,65,00,78,00,65,00,22,00,00,00
; REG_EXPAND_SZ "%SystemRoot%\System32\wsl.exe"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Bash\command]
@=hex(2):22,00,25,00,4c,00,6f,00,63,00,61,00,6c,00,41,00,70,00,70,00,44,00,61,\
00,74,00,61,00,25,00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,\
74,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,41,00,70,00,70,00,73,\
00,5c,00,77,00,74,00,2e,00,65,00,78,00,65,00,22,00,20,00,2d,00,70,00,20,00,\
55,00,62,00,75,00,6e,00,74,00,75,00,20,00,2d,00,64,00,20,00,22,00,25,00,56,\
00,22,00,00,00
; REG_EXPAND_SZ "%LocalAppData%\Microsoft\WindowsApps\wt.exe" -p Ubuntu -d "%V"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Command Prompt]
@="Command Prompt"
"Icon"=hex(2):22,00,25,00,43,00,6f,00,6d,00,53,00,70,00,65,00,63,00,25,00,22,\
00,00,00
; REG_EXPAND_SZ "%ComSpec%"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Command Prompt\command]
@=hex(2):22,00,25,00,4c,00,6f,00,63,00,61,00,6c,00,41,00,70,00,70,00,44,00,61,\
00,74,00,61,00,25,00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,\
74,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,41,00,70,00,70,00,73,\
00,5c,00,77,00,74,00,2e,00,65,00,78,00,65,00,22,00,20,00,2d,00,70,00,20,00,\
22,00,43,00,6f,00,6d,00,6d,00,61,00,6e,00,64,00,20,00,50,00,72,00,6f,00,6d,\
00,70,00,74,00,22,00,20,00,2d,00,64,00,20,00,22,00,25,00,56,00,22,00,00,00
; REG_EXPAND_SZ "%LocalAppData%\Microsoft\WindowsApps\wt.exe" -p "Command Prompt" -d "%V"
@Reedbeta
Copy link
Author

Reedbeta commented May 1, 2021

This is an alternate version of this gist, using Windows Terminal instead of legacy console windows.

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