It's not a VSC problem, you're using a poorly written extension ("Code Runner") to run your code.
When compiling a file with spaces in the name, the filename must be quoted (as shown in the other answers). The extension should do this automatically, but it doesn't.