:: portable cygwin setup setlocal enabledelayedexpansion :: be sure to mkdir /home/userdir once in bash so ~/ works. set path=%path%;%CD%\cygwin\bin set HOME=/home/userdir set DISPLAY=localhost:0.0 set CYGWIN=ntsec tty set SHELL=/bin/bash %CD%\cygwin\bin\umount -c %CD%\cygwin\bin\umount -A %CD%\cygwin\bin\mount -fub "%CD%/cygwin/bin" "/usr/bin" %CD%\cygwin\bin\mount -fub "%CD%/cygwin/lib" "/usr/lib" %CD%\cygwin\bin\mount -fub "%TEMP%" "/tmp" %CD%\cygwin\bin\mount -fub "%CD%/cygwin" "/" if [%1]==[bash_only] start "cygwin" mintty -e bash --login -i tasklist | findstr /i /C:screen.exe if not errorlevel 1 start "cygwin" mintty -e bash --login -i -c "screen -x -U -h 10000 -aA" & endlocal & goto :eof start "cygwin" mintty -e bash --login -i -c "screen -U -h 10000 -aA -D -RR" endlocal