First of all, are you sure the error is what you think it is?
g++.exe: error: CreateProcess: No such file or directory suggests that instead, some other executable that
g++.exe tries to invoke is missing.
Solving the 8192 Character Command Line Limit on Windows | MCU on Eclipse suggests using an MSYS-based toolchain (that post suggests some obscure one; you would probably be fine with MinGW). The UNIX emulation layer that those executables contain passes command line arguments via an inherited pipe when invoking another MSYS-based process.
Another options is to use a response file, a feature of GCC specifically present to overcome this limitation.