Update: *both* Lazarus and MSEide use custom built-in .BAT interpreters with limited functionality. They do not allow changing envvars once set! They fail silently at that, no warning.
The only exception as far as I can tell is PATH.