Skip to content

Instantly share code, notes, and snippets.

@matthewpwatkins
Created March 7, 2018 17:08
Show Gist options
  • Save matthewpwatkins/656fc3baa06b7d3577121316c0d61556 to your computer and use it in GitHub Desktop.
Save matthewpwatkins/656fc3baa06b7d3577121316c0d61556 to your computer and use it in GitHub Desktop.
Right-Click Bash Here

Make sure you have the Windows Subsystem for Linux installed. Then run the following script:

; Context menu for right-clicking the background of a directory or the desktop.
[HKEY_CLASSES_ROOT\Directory\Background\shell\Bash]
@="Bash..."
[HKEY_CLASSES_ROOT\Directory\Background\shell\Bash\command]
@="bash"

; Context menu for right-clicking folders.
[HKEY_CLASSES_ROOT\Directory\shell\Bash]
@="Bash..."
[HKEY_CLASSES_ROOT\Directory\shell\Bash\command]
@="cmd.exe /s /k pushd \"%V\" && bash"

Use Everything or another file finder to locate the ubuntu.exe executable that has the canonical logo. Copy the path of that exe. Then use Regedit to find the Bash folder created by the script. Add a new string value called Icon with the value of that exe path you added.

You should now have a right click menu option for "Bash..." with the Ubuntu logo

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