How can I associate .sh files with Cygwin?

前端 未结 13 1263
旧时难觅i
旧时难觅i 2021-01-29 21:32

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

13条回答
  •  抹茶落季
    2021-01-29 21:58

        Windows Registry Editor Version 5.00
        ;File:ConfigureShToBeRunUnderExplorer.reg v:1.0 docs at the end
        [HKEY_CLASSES_ROOT\Applications\bash.exe] 
    
        [HKEY_CLASSES_ROOT\Applications\bash.exe\shell]
    
        [HKEY_CLASSES_ROOT\Applications\bash.exe\shell\open]
    
        [HKEY_CLASSES_ROOT\Applications\bash.exe\shell\open\command]
        @="C:\\cygwin\\bin\\bash.exe -li \"%1\" %*"
    
        ; This is a simple registry file to automate the execution of sh via cygwin on windows 7, might work on other Windows versions ... not tested 
        ; you could add this setting by issueing the following command: reg import ConfigureShToBeRunUnderExplorer.reg 
        ; Note the path of your bash.exe
        ; Note that you still have to add the .sh to your %PATHTEXT%
                ; usage: double - click the file or reg import file 
    

提交回复
热议问题