So, the bottom line is that, in the PATH, Anaconda includes .bat files, that in turn call the actual .exe files in another directory. For instance, in the PATH, there is `g++.bat`, that calls `..\MinGW\bin\g++.exe`. This is different from EPD, where the actual .exe is in the PATH.
The "shell=True" option seems to be needed for `g++.bat` to be recognized as a suitable executable for command `g++` (only `g++.exe` would be recognized). However, specifying explicitly `g++.bat` instead of `g++` seems to work even when `shell=False`.
In any case, current solution is working fine, and I'm not sure if another solution would be better. Maybe try `g++`, then, if it does not work, try `g++.bat`, or try with shell=False, and then shell=True if it did not work? The problem with all of these is that we would have to track the result of the first call if we don't want to try two commands (the first of which fails) in general.