Proposal for new cygwin.bat which is independent from install directory

Christian Franke
Fri Aug 26 17:56:00 GMT 2016

Traditionally setup.exe creates the /cygwin.bat file as follows if 
C:\cygwin is the install directory:
@echo off

chdir C:\cygwin\bin

bash --login -i

The following should work since WinXP regardless of install directory:
@echo off

cd /d %~dp0
if errorlevel 1 exit /b 1
cd bin
if errorlevel 1 exit /b 1

bash --login -i

I would suggest to add something like the above as 
"/etc/defaults/cygwin.bat" to base-files package. The postinstall script 
should copy it to "/cygwin.bat" if new. The creation of this file could 
later be removed from setup.exe.

This more generic cygwin.bat is in particular useful for 'portable' 
installations of Cygwin on an USB device. I occasionally use such a 
installation to make rescue tools (dd, ddrescue, fdisk, hexedit, 
sleuthkit, ...) available to the minimal system provided by a Windows 
system repair CD.


Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list