根据微软帮助文档所说:
Setup will add Visual Studio Code to your %PATH%, so from the console you can type ‘code .’ to open VS Code on that folder. You will need to restart your console after the installation for the change to the %PATH% environmental variable to take effect.
将这个code.exe所在的文件夹配置到环境变量path里:
之后就能直接到项目文件夹下使用code .打开项目了。