Skip to content

Instantly share code, notes, and snippets.

@Reedbeta
Last active May 1, 2021 20:41
Show Gist options
  • Save Reedbeta/14def7276399916ce4166f3ae34a64b6 to your computer and use it in GitHub Desktop.
Save Reedbeta/14def7276399916ce4166f3ae34a64b6 to your computer and use it in GitHub Desktop.
Windows registry edit to add Bash and Command Prompt items to Explorer context menu
Windows Registry Editor Version 5.00
[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,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\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,43,00,6f,00,6d,00,53,00,70,00,65,00,63,00,25,00,22,00,00,\
00
; REG_EXPAND_SZ "%ComSpec%"
@Reedbeta
Copy link
Author

Reedbeta commented Feb 2, 2018

Updated the Bash icon path to its new location in the Win10 fall update (assuming you installed the Ubuntu package).

@Reedbeta
Copy link
Author

Updated the Ubuntu icon and command paths again

@Reedbeta
Copy link
Author

Reedbeta commented May 1, 2021

Updated to call wsl.exe in System32 instead of trying to go to the Ubuntu package, whose path keeps obnoxiously changing

@Reedbeta
Copy link
Author

Reedbeta commented May 1, 2021

I added an alternate version of this gist that opens these using Windows Terminal instead of the legacy console windows.

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