Table of Content

Here are 3 version of portable msys start script.

J:\portableapps\msys\usbmsys-sh.bat

@@echo off

::Get the current batch file's short path
for %%x in (%0) do set BatchPath=%%~dpsx
for %%x in (%BatchPath%) do set BatchPath=%%~dpsx
::echo BatchPath = %BatchPath%

::Change to the batch file's directory
cd %BatchPath%

echo #Automatically generated - modify fstab.model > etc\fstab
::replace fstab with current directory
for /F "eol=# tokens=1,2* delims=:" %%i in (etc\fstab.model) do @echo %~d0%%j >> etc\fstab

::launch msys bash terminal

start bin\bash --login -i

etc\fstab.model

X:/portableapps/mingw /mingw
X:/portableapps /portable

rxvt version

J:\portableapps\msys\usbmsys-rxvt.bat

@echo off

::Get the current batch file's short path
for %%x in (%0) do set BatchPath=%%~dpsx
for %%x in (%BatchPath%) do set BatchPath=%%~dpsx
::echo BatchPath = %BatchPath%

::Change to the batch file's directory
cd %BatchPath%

echo #Automatically generated - modify fstab.model > etc\fstab
::replace fstab with current directory
for /F "eol=# tokens=1,2* delims=:" %%i in (etc\fstab.model) do @echo %~d0%%j >> etc\fstab

::launch msys rxvt terminal
start bin\rxvt -backspacekey  -tn msys -sl 3000 -fn Courier -fg white -bg black -sr -e /bin/bash --login -i

Console2 version

J:\portableapps\msys\usbmsys-console2.bat

@echo off

::Get the current batch file's short path
for %%x in (%0) do set BatchPath=%%~dpsx
for %%x in (%BatchPath%) do set BatchPath=%%~dpsx
::echo BatchPath = %BatchPath%

::Change to the batch file's directory
cd %BatchPath%

echo #Automatically generated - modify fstab.model > etc\fstab
::replace fstab with current directory
for /F "eol=# tokens=1,2* delims=:" %%i in (etc\fstab.model) do @echo %~d0%%j >> etc\fstab

:: launch msys Console2 terminal from script
:: start %~d0%\portableapps\Console2\Console

:: launch msys bash inside Console2
bin\bash --login -i