Programming & Coding How-TosTechnology

Make VS Code Terminal Open Command Prompt Instead of PowerShell

Admin
Make VS Code Terminal Open Command Prompt Instead of PowerShell

On Windows, the integrated terminal in VS Code opens PowerShell by default. That is fine for many people, but it can be annoying if your course, job, or old scripts expect Command Prompt. Commands, prompts, and habits do not always match between the two shells.

You do not need to change Windows itself to fix this. VS Code lets you choose which shell opens every time, and you can do it in less than a minute. This guide shows the settings method, the quick manual method, and how to make the change stick for every new terminal.

Quick Answer

To make the VS Code terminal open Command Prompt instead of PowerShell, open Settings, search for terminal default profile, and choose Command Prompt as the default profile for Windows. You can also click the small arrow next to the plus icon in the terminal panel and select Command Prompt for a single session. New terminals will then open with cmd.exe instead of PowerShell.

Understanding Terminal Profiles in VS Code

VS Code does not have just one terminal. It supports several shells through something called profiles. On Windows, common profiles include PowerShell, Command Prompt, and Git Bash if Git is installed.

A profile is simply a saved recipe. It tells VS Code which program to start, where it lives, and which icon to show. When you understand profiles, the setting stops feeling mysterious. You are not hacking the editor; you are just picking a different default recipe.

PowerShell and Command Prompt Are Not the Same

Command Prompt is the classic Windows shell that runs cmd.exe. It uses familiar commands such as dir, cd, and batch files ending in .bat. PowerShell is newer and more powerful, with its own commands and scripting language.

Both can do everyday jobs like running Node, Python, or Git. Problems appear when a tutorial uses one shell and your terminal opens the other. Error messages can look different, and some commands behave in surprising ways for beginners.

Method 1: Change the Default Profile in Settings

This is the best method if you want Command Prompt every time. It takes only a few clicks and survives restarts.

  1. Open VS Code and press Ctrl+, to open Settings.
  2. In the search box, type default profile windows.
  3. Find the setting named Terminal > Integrated > Default Profile: Windows.
  4. Open the dropdown and select Command Prompt.
  5. Close any open terminal with the trash icon, then open a new one with Ctrl+`.

Your new terminal should show a path like C:\Users\YourName> with no PowerShell wording. That plain prompt is the clearest sign that Command Prompt is now your default.

The steps above follow the approach described in the official VS Code terminal profiles documentation, which explains how default profiles work on each operating system.

Method 2: Pick Command Prompt for One Session Only

Sometimes you do not want a permanent change. Maybe you normally like PowerShell, but one old script needs Command Prompt today. VS Code handles that nicely too.

  1. Open the terminal panel with Ctrl+` if it is hidden.
  2. Look at the top-right of the terminal panel for the plus icon.
  3. Click the small dropdown arrow next to the plus icon, not the plus itself.
  4. Select Command Prompt from the list of profiles.
  5. A new terminal tab opens using Command Prompt, while your old one stays untouched.

You can even run both side by side. Each terminal tab keeps its own shell, history, and running tasks. This is handy when you compare how the same command behaves in each shell.

Method 3: Set the Default in settings.json

If you prefer editing settings as text, you can set the profile directly in JSON. This method is popular with people who copy their setup between computers.

  1. Press Ctrl+Shift+P and run Preferences: Open User Settings (JSON).
  2. Add this line inside the main braces: "terminal.integrated.defaultProfile.windows": "Command Prompt"
  3. Save the file with Ctrl+S.
  4. Kill the current terminal and open a fresh one to test.

Be careful with commas and quotes in JSON. A missing comma can break the whole settings file, and VS Code will show a red underline to warn you. If that happens, compare your line carefully with the example above.

What If Command Prompt Is Missing From the List?

On a normal Windows install, Command Prompt should always be available because cmd.exe is part of Windows. If it does not appear, VS Code may have failed to detect your shells.

Restart VS Code first. If it is still missing, you can define it manually in settings.json with a profile that points to C:\Windows\System32\cmd.exe. The VS Code terminal basics guide explains how profiles are detected and where custom profiles can be added.

How to Confirm the Change Worked

Do not trust the setting alone; test it. Open a brand-new terminal and look at the prompt and the tab label.

  • The tab should be labelled cmd or Command Prompt.
  • The prompt usually ends with a simple > character.
  • Typing echo %COMSPEC% should print the path to cmd.exe.
  • Typing $PSVersionTable, a PowerShell command, should fail with an error.

If an old PowerShell terminal is still open, that does not mean the setting failed. Changing the default only affects new terminals. Close the old one with the trash icon and open another.

Making Command Prompt Work Well for Development

Once Command Prompt is your default, a few small habits make life easier. Learn how it handles paths with spaces by using quotes, for example cd "My Projects". Remember that Command Prompt uses backslashes in paths, although many modern tools accept forward slashes too.

If your work involves running JavaScript outside the browser, pairing this setup with a correct Node.js install matters just as much as the shell itself. Our step-by-step guide on how to install Node.js on Windows walks through the install and the version checks you can run in your new terminal.

Switching Back Later

Nothing here is permanent. If a future course asks for PowerShell, repeat the settings steps and choose PowerShell as the default profile again. Your files, extensions, and other settings stay exactly as they were.

You can also keep both habits alive. Set the default to the shell you use most, and open the other one from the dropdown whenever a specific task needs it.

Common Mistakes to Avoid

  • Testing in the old terminal: The default only applies to new terminals, so always close and reopen before judging.
  • Clicking the plus icon only: The plus opens the current default; use the small arrow to pick a different profile.
  • Editing the wrong settings file: Workspace settings affect one project only, while user settings affect everything.
  • Breaking JSON syntax: One missing comma in settings.json can stop all your settings from loading.
  • Changing Windows Terminal instead: Settings in the separate Windows Terminal app do not control the VS Code terminal.
  • Expecting old commands to vanish: Each open terminal keeps its shell until you close it.

Conclusion

Making VS Code open Command Prompt instead of PowerShell is a simple profile change. Use the Settings dropdown for a permanent fix, the terminal arrow for a one-off session, or settings.json if you prefer text. Test with a fresh terminal, and you will always know exactly which shell you are working in.

Frequently Asked Questions

Why does VS Code open PowerShell by default on Windows?

Microsoft ships PowerShell as the modern default shell on Windows, and VS Code follows that choice. It is a starting point, not a rule, and you can change it freely.

Will changing the default terminal delete my PowerShell?

No. PowerShell stays installed on your computer and inside the VS Code profile list. You are only choosing which shell opens first in new terminals.

Can I use Command Prompt and PowerShell at the same time?

Yes. Open one terminal normally, then use the dropdown arrow next to the plus icon to open the other shell in a second tab. Both can run at once.

Does this setting apply to all my projects?

If you change it in User Settings, yes, it applies everywhere. If you change it in Workspace Settings, it applies only to that one project folder.

What is the keyboard shortcut to open a new terminal?

Press Ctrl+` to show or hide the terminal panel. To create another terminal instance, use the plus icon in the panel or the Terminal menu.

Admin

Passionate about the intersection of style and storytelling. I simplify fashion trends and industry news into easy-to-follow advice, helping you stay stylish and informed in the fast-paced world of fashion.

Leave a Reply

Your email address will not be published. Required fields are marked *