On Tue, 12 Jul 2011, Brian Wood wrote:

> Mike Miller:
>
>> Do you mean that when you are in front of the machine, using it's 
>> keyboard and using Cygwin, it compiles OK but when you log in remotely 
>> and try the same thing, it does not compile OK?
>
>
> Neither of those work.  The PATH variable doesn't seem to be affected by 
> running the .bat file.  It only works when I'm in front of the Windows 7 
> machine and run cmd.exe.  Sorry for the off-topic question.  I'll go ask 
> in a Cygwin forum now that I think about where else to ask about this.


I think I understand the problem.  When you run a batch file in Windows, I 
guess it can change environment strings.  That is not how it works in a 
bash shell in Linux/UNIX or Cygwin.  With bash, a shell script creates a 
new shell with its own environment and changes to environment strings 
occur only there.  When that shell terminates, so do the changes.  To make 
changes in your shell, you have to either type them on the command line or 
source a file, not execute a shell script.  If it's a setting you will 
always want, you should change the path in ~/.bash_profile (you have to 
use the bash syntax, not Windows syntax).  If you only want the path 
sometimes, write the path line in a file and then source the file.  For 
example:

cat path_file
PATH=/cygdrive/c:/cygdrive/c/progs:/cygdrive/d/more-progs

source path_file

You also can't just run a Windows batch file, I don't believe, in Cygwin. 
You will want to change how that works -- either using shell scripts to 
perform tasks or sourcing files to change the environment.

Mike