When trying to open vscode folder using a batch file, Visual Studio opens up with that folder, but also a cmd window pops up and does not go away if you use exit command.
@echo off
start code "C:\GitHub\TestApp\testapp"
exit
VSCode opens up correctly, but also this window opens

Using VSCode 1.52.1, the only way I could start it without having a cmd window open after exiting the batch script is:
explorer.exe "%userprofile%\AppData\Local\Programs\Microsoft VS Code\Code.exe"
Note: it does not involve opening a specific local directory to work with. But maybe you can find a solution such as saving the folder as a workspace or using Ctrl+R to open recent folders. Plus, if you work only within that directory / workspace, or use it right before closing VSCode, it will be opened automatically at the next launch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With