need to open a shell window from the Windows explorer. This can be
done via a context menu entry for a folder. Right-click on a folder,
and open a shell window with that folder as the current working
directory. That will be really nice, right. Windows itself also
has a toy called cmdhere, which does the
similar thing but brings up the cmd.exe window.
So how to do the cygwin/msys shell window? I search around a bit.
There are many post on the Web. But I think I settle down on this
simple one. First you need to write a bat file that take one
argument, which is the working directory. Second, you need to
modify the registry entry to add context menu for this bat file
for the folder type context menu. The bat files for my cygwin
shell is like this:
@echo off
start /min C:\cygwin\bin\bash --login -i -c 'cd "`cygpath %1`"; rxvt +sb +vb '
The msys version bat is like this:
@echo off
start /min C:\cygwin\bin\bash --login -i -c 'cd "`cygpath %1`"; rxvt +sb +vb '
Then add a new key under the "My ComputerHKEY_CLASSES_ROOT\Folder\shell"
registry entry. The new key's name can be something lik Cygwin_here/msys_here.
Then add a new key called "command" under this new entry, with the value
to be your bat file with the "%1" argument. My exported registry entry is
like these:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\Cygwin_Here]
@="Cygwin Here"
[HKEY_CLASSES_ROOT\Folder\shell\Cygwin_Here\command]
@="C:\\cygwin\\rxvt_here \"%1\""
[HKEY_CLASSES_ROOT\Folder\shell\Msys_Here]
[HKEY_CLASSES_ROOT\Folder\shell\Msys_Here\command]
@="c:\\msys\\1.0\\msys_here \"%1\""
No comments:
Post a Comment