Open Cygwin at a specific folder

后端 未结 29 2651
悲哀的现实
悲哀的现实 2020-12-12 08:49

How can I create a Cygwin shortcut that will open Cygwin at a specific folder? This would obviate having to type

cd /cygdrive/c/Users/Tom/Desktop/

29条回答
  •  盖世英雄少女心
    2020-12-12 09:14

    @echo off
    C:
    SET mypath=%~dp0
    c:\cygwin\bin\bash -c "cd '%mypath%'; export CHERE_INVOKING=1; exec /bin/bash --login -i"
    

    Copy above commands in a text file and save it as .bat in any of "your folder of interest". It should open cygwin in "your folder of interest".

提交回复
热议问题