Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

  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.

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",

}

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.

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! :)


open settings (ctrl+comma)

find terminal.integrated.shell.windows

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