Platformio Upload Error for Arduino Uno Wifi Rev2

Actually there is also another fix possible: You can re-install PlatformIO into a different folder by setting up the PLATFORMIO_CORE_DIR system environment variable. You can use that to get rid of the space inside the path C:\Users\Wong Zhi Wei\.platformio\ (which is the PlatformIO core). This has been discussed in e.g. Install platformio in different folder on Linux - #3 by ivankravets and Specify Path to PlatformIO in Visual Studio Code - #11 by maxgerhardt.

An issue about this bug has been opened at Users can't upload to Uno WiFi Rev2 because of argument escaping problem · Issue #33 · platformio/platform-atmelmegaavr · GitHub.