vineethc4f
vineethc4f

Reputation: 319

Open CMD in the Visual Studio Code terminal

Whenever I open the terminal in Visual Studio Code, I get a bash shell. I want to add CMD as a second shell. To do that, I went through the VS Code documentation and found this command:

CTRL+SHIFT+`

But it only opens a second bash shell. Is there a shortcut for opening CMD in the integrated terminal, rather than opening it in an external console?

Screengrab showing console window in VSCode

Upvotes: 31

Views: 83396

Answers (8)

Khapi
Khapi

Reputation: 650

  1. Press Ctrl + Shift + P to open the command palette.
  2. Type 'profile' in the searcher.
  3. Select 'Terminal: Select Default Profile'.
  4. Select 'Command Prompt'
  5. The next time you try to open the terminal you should see 'CMD' instead of 'PowerShell'.

Upvotes: 35

liv jeez
liv jeez

Reputation: 21

Opening the cmd terminal from VSCode

Ctrl + Shift + C

Upvotes: 2

scwol111
scwol111

Reputation: 116

You can change your current terminal to whatever you need (or have).

enter image description here

Or you can use Ctrl + Shift + P to open the Command Palette and type Terminal Profile, then change the default profile.

enter image description here

enter image description here

This will change your startup terminal. If you start a new one, the default terminal will always open.

Upvotes: 5

Maxenn
Maxenn

Reputation: 1

If you want to open another CMD terminal, from the VS Code terminal or any other terminal, use

@start run cmd . 

or when you want to go on dir above and open cmd there:

cd .. & @start cmd .

Upvotes: 0

Suyash
Suyash

Reputation: 420

I don't know why anyone else hasn't mentioned it yet, but here's the simplest way to open CMD in VSCode.

Just type CMD in the terminal and hit enter.

Upvotes: 9

Llewey
Llewey

Reputation: 9242

If you want to always open cmd, you can use the settings to configure that.

From the docs:

Correctly configuring your shell on Windows is a matter of locating the right executable and updating the setting. Below are a list of common shell executables and their default locations:

// Command Prompt
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"
// PowerShell
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
// Git Bash
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\git-cmd.exe",
"terminal.integrated.shellArgs.windows": [
  "--command=usr/bin/bash.exe",
  "-l",
  "-i"
]
// Bash on Ubuntu (on Windows)
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\bash.exe"

If you want to only sometimes open cmd, you may be able to simply open a new bash terminal and then run cmd in it.

If you use both frequently, you may want to use an extension like this or this which allow you to pick your terminal when you launch it.

Keybindings:

  [{
    "key": "ctrl+shift+t",
    "command": "shellLauncher.launch"
  }]

Settings:

  {
    "shellLauncher.shells.windows": [
      {
        "shell": "bash",
        "args": [],
        "label": "bash"
      }, {
        "shell": "cmd",
        "args": [],
        "label": "cmd"
      }
    ]
  }

Upvotes: 15

user10154568
user10154568

Reputation:

Add this on user setting Note: paste at top

{

   "terminal.integrated.shell.windows": "cmd.exe"
    // other settings...

}

Upvotes: 8

Ochan Charles Taylor
Ochan Charles Taylor

Reputation: 31

Just open the terminal and enter the link to your cmd application e.g C:\Windows\system32\cmd.exe

Upvotes: 3

Related Questions