I have two different installs of the cygwin linux tool kit. The starting point for this tool kit is to open a bash shell in a mintty terminal. This is done with a shortcut with the following target,
C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -
In order for things to work properly, I need to add C:\cygwin\bin to the windows path. Since I have two versions of cygwin, at times I need to add C:\cygwin\bin, and at times I need to add C:\cygwin2\bin. They cannot both be in the path at the same time. The string needs to be added to the path for the session and then removed when the session is closed out.
I thought about setting up a bat file that looks like,
SET PATH = C:\cygwin\bin;%PATH%;
start C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -
this should add cygwin to the path and then start the terminal. This works more or less, but I'm not sure that cygwin has actually been added to the path, and I don't know that this addition is temporary for the current session. I looked at using "setlocal", but I don't know what that does in this context. The bat file finishes and closes, leaving the cygwin terminal running. It would seem that setlocal would expire when the bat file closes, so that doesn't seem right since mintty would still be running. I need the addition to the path to expire when the mintty terminal closes. I don't see any practical way to do that, so I think what I need is a bat file that will not close right away but will have to be manually closed. Something like,
Code: Select all
@ ECHO OFF
setlocal
SET PATH = C:\cygwin\bin;%PATH%;
start C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -
echo C:\cygwin\bin added to path
set /p WHATEVER=press enter to exit and clear path
exit
I think this will work, but I have no real way of knowing. Am I even close here???
Thanks for the advice.
LMHmedchem