Category Archives: Cygwin

How do I add Cygwin to folder context menus?

From the mailing list for the Cygwin project:

To have Windows Explorer start a Bash console window in any directory that you right click on, save the following lines to a file with a .reg extension, change the command lines to point to where bash.exe is installed, and run the file. You can change the string that appears in the context menu by changing"&Bash This" to your preferred string. The character after'&' is the shortcut key for the command. You can also download my pre-made .reg file here.

REGEDIT4

[HKEY_CLASSES_ROOT\Directory\shell\BashHere]
@="&Bash This"

[HKEY_CLASSES_ROOT\Directory\shell\BashHere\command]
@="c:\\cygwin\\bin\\bash.exe –login -c \"cd '%1' ; exec /bin/bash -rcfile ~/.bashrc\""

[HKEY_CLASSES_ROOT\Drive\shell\BashHere]
@="&Bash This"

[HKEY_CLASSES_ROOT\Drive\shell\BashHere\command]
@="c:\\cygwin\\bin\\bash.exe –login -c \"cd '%1' ; exec /bin/bash -rcfile ~/.bashrc\""

Cygwin SSHD not functioning at startup

I have seen this problem crop up on many Windows XP/2003 boxes:

If you install cygwin's sshd as a system service set to start automatically at startup you may run into problems. You may find that your connection will simply be reset, when you check on the service you will find it in a running/started state. The workaround is simple, launch cygwin's package manager and install the utility 'rebase'. Once you have the package installed shutdown all cygwin shells and sshd. Drop to the command prompt (start > run > cmd) and change to cygwin's bin directory (cd C:\cygwin\bin) and run:

ash rebaseall

That's it! Upon startup you will find that sshd is up and functioning properly.