Do you have any antivirus software installed beyond just the built-in windows ones? Some reports I’ve read say that e.g. malwarebytes may block cmd.exe execution. Also check that your system PATH includes C:\WINDOWS\system32 (you can test this by typing Win+R and entering cmd.exe)
The actual functionality resides in the Gradle tasks, not VS Code. It seems that there’s a problem with the way VS Code executes the Gradle tasks on your system, but the functionality itself works properly. Is this standard Windows 10, and have you run the correct installer for your system (32/64 bit)?