I'm trying to create a batch file that opens Visual Studio Code. I'm using this SO answer as a guide to do so. This is the command I end up with:
start "MyTitle" "C:\Program Files\Microsoft VS Code\bin\code.cmd" "C:\MyFolder"
When I run this, I see two command windows appear:
- One window runs the command and closes immediately. I think this is right.
- The other window is titled "MyTitle" and gives me this error message:
- 'C:\Program' is not recognized as an internal or external command, operable program or batch file.
What am I doing wrong? Do I need to escape the spaces in that path?
I've found a lot of SO questions relating to this, and I've tried the solutions I've found, but I can't get anything to work. Here are some answers I've found and tried: