Visual Studio Code, how to switch from powershell.exe to cmd.exe

Visual Studio-Code

Visual Studio-Code Problem Overview


I would like to switch from powershell.exe to cmd.exe in the terminal but i'm not sure how to do so. Provided screenshot for clarification.

screenshot 1 screenshot 2

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

  1. Press Ctrl+Shift+P to show all commands.
  2. Type profile in the displayed text box to filter the list.
  3. Select Terminal: Select Default Profile.
  4. You will be prompted to Select your preferred terminal shell, you can change this later in your settings or follow the same process as we do now
  5. Select Command Prompt (cmd.exe)
  6. Click the Delete Icon in the shell pane to remove the existing terminal.
  7. Press Ctrl+` (or View > Terminal in menu) to open a new terminal pane.

Solution 2 - Visual Studio-Code

Add this user settings to your File -- Prefernces -- User Settings

// Place your settings in this file to overwrite the default settings
{
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
    
}

Solution 3 - Visual Studio-Code

I found two different ways to switch from powershell to command prompt in VSCode. Very simple steps i found my self as below:

First one is very simple way:

  1. Press Ctrl+` (or View > Terminal in menu) to open a new terminal pane.
  2. Click terminal selection dropdown and click 'Select Default Shell'.

enter image description here

  1. Choose terminal type Command Prompt or PowerShell

enter image description here

  1. Now Delete current opened terminal or open new terminal.

Now, Command Prompt will be your default shell in VSCode.


Second one is also simple and handy for all devs.

  1. Press Ctrl+Shift+P to show all commands.
  2. Type shell in the displayed text box to filter the list.
  3. Select Terminal: Select Default Shell.
  4. You will be prompted to Select your preferred terminal shell, you can change this later in your settings or follow the same process as we do now
  5. Select Command Prompt (cmd.exe)
  6. Click the Delete Icon in the shell pane to remove the existing terminal.
  7. Press Ctrl+` (or View > Terminal in menu) to open a new terminal pane.

Solution 4 - Visual Studio-Code

2021 Update:

Hit Ctrl+Shift+P

Type/Paste : Terminal: Select Default Profile

VS code Settings

Select the command prompt from the drop down list.

enter image description here

Thanks! :)

Solution 5 - Visual Studio-Code

open settings (ctrl+comma)

find terminal.integrated.shell.windows

replace its value with C:\\Windows\\System32\\cmd.exe

Solution 6 - Visual Studio-Code

I also faced this problem that when I clicked on terminal. It was showing Powershell but not Command Prompt, so I did the following steps to get Command Prompt in Visual Studio:

  1. View -> Command palette -> Toggle Integrated Terminal

  2. Open terminal by shortcut ctrl+` or View -> terminal

  3. Write the command as cmd.exe and run

Solution 7 - Visual Studio-Code

In the current terminal ,simply type cmd and enter. And you are done.

Solution 8 - Visual Studio-Code

From Visual Studio if you have powershell set as your default integrated terminal, after you call it with Ctrl-` (control backtick) - that toggles from the terminal to your files panel and back. Call the terminal, It will show as 1: pwsh in the dropdown box. From the powershell command line type bash and enter. You have your bash prompt $. In the dropdown you now see 1: bash.

You can type cmd from either the ps C: or the $ bash prompt and open the windows command prompt. C:> and exit to exit them.

You can open up multiple terminals. Say powershell (pwsh) is your default one. A new terminal will show as 2: pwsh which you can change to a cmd one. The same if you open a third. Change it to bash. You now have 3 terminals 1: pwsh, 2: cmd, and 3: bash. You can select whichever one you want to work with from the dropdown. You can of course exit any of them.

No doubt you've seen that when you are running node.js, the terminal becomes node.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser6252698View Question on Stackoverflow
Solution 1 - Visual Studio-CodeHariprasath YadavView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeAravindView Answer on Stackoverflow
Solution 3 - Visual Studio-CodeBhavinD.View Answer on Stackoverflow
Solution 4 - Visual Studio-CodeAbhishek GautamView Answer on Stackoverflow
Solution 5 - Visual Studio-Codemuthu kumarView Answer on Stackoverflow
Solution 6 - Visual Studio-CodePuja SharmaView Answer on Stackoverflow
Solution 7 - Visual Studio-CodeSaikrishnareddymsView Answer on Stackoverflow
Solution 8 - Visual Studio-Codeuser258081View Answer on Stackoverflow