I can follow below sequence of actions to run the Visual Studio Code in the current folder.
select the location bar in the current folder and run (ALT + D):
cmd /k code .
I've tried to wrap the code . in the batch file (and place it in a folder where is declared in the PATH variable to run it as its own), it launches "Visual Studio Code" but doesn't close the command window until i close the visual studio code.
i know "start" command need to be there with exit command in the end but so far the combinations i've tried didn't really let me achieve that.
cmd.exe /k code .
exit
Any ideas?
Then, use the Tasks: Run Build Task hotkey ( Ctrl Shift B by default). You can have more than one such task. At most one task can have "isDefault": true , the one that Ctrl Shift B should run. Show activity on this post.
Go to the directory in the command pallet on your computer the navigate to the the specific folder using cd the type code . and that will open the folder and the files in it inside vs code. works like a charm.
If you already have a Terminal session running, quit or restart it. When you are in the directory of the files you want to open in VS Code, type code . (that is the word “code” followed by a space, then a period) and the folder will automatically open in VS code.
this works for me, Do not omit the first empty quote
Start "" "C:\Program Files (x86)\Microsoft VS Code\code.exe" <path_to_dir>\.
This works for me (be sure to start code
and exit
at the bottom of the batch file):
start "" code
exit
If you just want to start vscode from current folder from command line type
code %cd%
@start code .
@start code "<Specific Folder>"
@start code "<Specific File>"
Save file as .bat
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