I\'d like to run a long rsync command in Cygwin by double clicking on a .sh file in Windows. It must start in the file\'s containing directory (e.g. /cygdrive/c/scripts/) so th
Here is my solution. It works well for my *.sh scripts regardless of where they are in the directory hierarchy. Notice that I cd to the cygpath dirname before calling bash on the cygpath. It just works.
assoc .sh=bashscript
ftype bashscript=C:\cygwin\bin\bash.exe --login -i -c 'cd "$(dirname "$(cygpath -u "%1")")"; bash "$(cygpath -u "%1")"'