Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wish to add a command on right click menu in explorer that opens current directory with cygwin.

For same I have successfully added these registries:

@="c:\\cygwin\\bin\\bash.exe --login -i -c \"cd '%1'; bash\""

@="c:\\cygwin\\bin\\bash.exe --login -i -c \"cd '%1'; bash\""

but this adds the command only when on some folder or drive. I want generic right click on explorer, on which, search gives me this registry to edit:

@="c:\\cygwin\\bin\\bash.exe --login -i -c \"cd '%1'; bash\""

My problem lies with the value of the key, which doesnt work on %1 but on some static value like /cygdrive/c

Could someone please tell me the proper way to pass current directory to the command, also please refer me some basic and advanced pages for same.

share|improve this question

migrated from Mar 18 '11 at 20:27

This question came from our site for professional and enthusiast programmers.

I think this is what the chere package does. Instead of tweaking the registry entries yourself, it might be easiest just to install that.

share|improve this answer

Better option - No registry edit --

On Win 7:

  1. Right click and Open Cygwin as Administrator.
  2. type "chere -i" or "chere -i -t mintty" if you would like to use Mintty which I personally prefere.
share|improve this answer
Please add a bit of summary, the link will break sometime. – vonbrand Apr 23 '13 at 23:34
This worked for me, but I had to install the chere package first, and run it as chere -i -s bash. – Brian Z Jan 28 at 22:03

This is actually better than Cygwin’s chere in my opinion because it only launches once instance of bash.exe. If you look in Task Manager you will notice chere requires 2 instance of bash.exe to work. Not a huge deal but unecessary and annoying.

'directory', 'directory\background', 'drive' |
% {'cmd /c start /d "%v" bash' | ni -f hklm:\software\classes\$_\shell\bash\command}


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.