I wanted to add a “Bash Here” context entry when I right click on a directory:
This Bash Here would open that directory in Cygwin (mintty).
My current PC is fairly regulated, so without admin rights and thus I can’t use the CHere option which I would normally use.
I just created the registry keys via regedit and that works fine.
You can use two options:
- Import the registry file mentioned below
- Create the keys yourself
1. Import the registry file
Create a file called cygwin_bash_here.reg with the following contents:
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Classes\Directory] [HKEY_CURRENT_USER\Software\Classes\Directory\shell] [HKEY_CURRENT_USER\Software\Classes\Directory\shell\bashhere] @="Bash Here" [HKEY_CURRENT_USER\Software\Classes\Directory\shell\bashhere\command] @="C:\\cygwin\\bin\\mintty.exe"
Save the file and double click on it to import it to the registry.
2. Create the keys yourself
- Open the registry editor: Start – Run – “regedit”
- Open the following path: HKEY_CURRENT_USER\Software\Classes
- Create key: “Directory”
- Inside Directory, create key: “shell”
- Inside shell, create key: “bashhere”
- Inside bashhere double click on the standard key and insert text “Bash here” without quotes (This is the text which is displayed in the context menu.
- Inside bashhere, create key: “command”
- Inside command, double click on the standard key and insert text “C:\cygwin\bin\mintty.exe” without quotes. Important: This is the command which is run. Please change directory to your cygwin directory
Both options will create a context menu item which opens Cygwin at your current windows directory!