I\'m heavily using Cygwin (with PuTTY shell). But, it\'s quite tricky to invoke cl.exe (that is, the Visual C++ compiler toolchain) in the Cygwin Bash shell. R
None of the other answers worked for me, but this did:
dump the env vars: set > c:\temp\cl.env
Open a cygwin command prompt and create a source script:
awk < /cygdrive/c/temp/cl.env -F= '{ if($1 !~ ")") print "export " $1 "=\x27" $2 "\x27" }' > cl.source
Modify cl.source to change TEMP and TMP to C:\Temp e.g. TEMP='C:\Temp'
Now, whenever you need the cl environment, from your cygwin prompt run:
source cl.source
Optionally, source cl.source in your .bashrc file to run automatically when you log in