How to create a shortcut that opens Cygwin bash shell on a directory of the choosing (UNC especially)

bashcygwin;shellunc

Given a standard installation of Cygwin for Windows XP, I would like to create a standard Explorer shortcut that opens a bash shell already open on a directory of my choosing. The directory is a UNC path. The standard cygwin.bat doesn't work because it invokes cmd.exe, and cmd.exe does not like UNC paths. Ideally, it doesn't start cmd.exe or any other shell to open bash. I've tried manipulating .bashrc and dredging my memory from my Unix days, but sadly that's lacking these days. Various solutions I've tried are almost working, but not quite.

Best Answer

I haven't toyed with UNC paths, but in general you have to use forward slashes instead of backslashes I believe. For regular drives, you can use /cygdrive/c for example to access the C drive.

In a batch file, to open the shell to the root of C: you could use:

c:\cygwin\bin\bash.exe --login -i -c 'cd "/cygdrive/c";bash'

You may also be interested in chere a context menu entry for Open bash here:

alt text

Related Question