Extra VS Code Settings for Windows

If you find that your settings.json already has some lines there, make sure you add a , after the last line before entering the text from this lesson or setting changes may not work.

For example you may see this:

{
    "C_Cpp.updateChannel": "Insiders",
    "files.autoSave": "off",
    "editor.fontSize": 18
}

You’ll need to add a , after the 18 then paste the extra code:

{
    "C_Cpp.updateChannel": "Insiders",
    "files.autoSave": "off",
    "editor.fontSize": 18,
    "terminal.integrated.shell.windows": "cmd.exe",
    "terminal.integrated.shellArgs.windows": [
        "/k", "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools\\VsDevCmd.bat"
    ]
}
1 Like

im using the 2019 version of visual studio, heres what works for me, note the double quotes need to be fixed if your copying and pasting;

{
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
    "terminal.integrated.shellArgs.windows": [
    "/k", "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools\\VsDevCmd.bat"
    ]
    }

i installed all the build tools in the visual studio installer, in c++ build tools.

finally i did this from a persons post above;

View > Command Palette > Terminal: Select Default Shell > Command Prompt
2 Likes

Please help this is tiring, any alternative or some god who can help me? ive tried everything in this thread aaaaaa *****************************

1 Like

Youve got way more in that than you need.

{
“terminal.integrated.shell.windows”: “cmd.exe”,
“terminal.integrated.shellArgs.windows”: [
“/k”, “C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat”
]
}

My terminal is refusing to pull up cmd. It only stays on 1.powershell.
Ive tried using other code from other peoples replys about this issue but mine refuses to work.

3 Likes

Already tried that man

@Jojo21k let me see if I can help you one step at time, make sure you have Visual Studio 2017 or 2019 installed that is part of your 3rd step below
1st make sure you have c++ extension installed that was given in Sect.1 Ep11
2nd press " once. As you type there should be multiple selections as you type terminal, once you at point of typing shell press down arrow key that has .windows and press enter everything else filled on screen don’t do anything else to that line and press enter
3rd in your windows start button go to search and type developer command prompt right click on it, click properties highlight and copy most everything in target FROM /k all the way to .bat file. you will be posting it like this “terminal.integrated.shellArgs.windows” : [ paste file here add extra \ so that there are two] dont forget to add " for k “/k”, go to file and save and see if it works this is how mine looks. Hope it helps

I really like that time was taken to show where the command line text came from. Because of this, I was able to troubleshoot my own issue. At the time I was going through this video, my install was VS 2019. Just had to change the line slightly!

hello

not getting anything upon inputting CL
image

opened developer cmd and it works
image

using this code

any ideas what i may be doing wrong?

1 Like

This is what fixed it for me. I encourage everyone to look at there directory also.

Hey all, For anyone having trouble with “cl” not working, make sure after you paste the code you save it. It’s easy to forget, but it won’t work otherwise

3 Likes

How do I fix this problem" “C:\Program” is not recognized as an internal or external command, operable program or batch file"?

1 Like

Most of the issues in this thread are due to people needing to match the ACTUAL locations of their various installs, compilers and cmd instead of copying an example location. So, browse to the locations of the items using your Windows Explorer, etc and note the locations. Edit accordingly, and note the appropriate syntax, such as the double " \ \ " in the directory structure, or the commas at the ends of the lines.

I had to root around in my custom install until I figured out where everything wanted to be found… :slight_smile:

it isn’t saying what it is aspost to when i type c

it wolnt work iv tried a million things!!!

@Poolsharkc_Plays @tylerlowrey

\Tools\ Not *\BuildTools* BuildTools directory its for VS2017
if this doesnt works, return to copy the route with \k included. Then add the other symbols. “,” “\” and so on… Try to delete all the line route before. this workds for me.
Developer%20tool%202019

{
“terminal.integrated.shell.windows”: “cmd.exe”,
“terminal.integrated.shellArgs.windows”:[
“/k”, “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat”]
}

Developer%20tool%202019%202

1 Like

@Navneet_Bhattacharje

I had the same issue that you did. In order to fix this issue, I had to use the caret (^) escape character to fix my “terminal.integrated.shellArgs.windows” (which I found out from here: https://stackoverflow.com/questions/52459661/visual-studio-code-task-build-c-program-is-not-recognized)

My settings.json file now looks like this:

{
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
    "terminal.integrated.shellArgs.windows": [
        "/k", "C:\\Program^ Files^ ^(x86^)\\Microsoft^ Visual^ Studio\\2017\\Community\\Common7\\Tools\\VsDevCmd.bat"
    ],
   // "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
    "workbench.startupEditor": "newUntitledFile"
}

Note: You do not need the last two lines (the one that has the // in front or the workbench.startupEditor line. Also, the part after C:\\Program^ Files^ ^(x86^)\\Microsoft^ Visual^ Studio\\ may be different than what you have, depending on what version of visual studio code you have. You can figure this out by going to the C drive > Program Files (x86) > Microsoft Visual Studio folder and seeing what folders you have there to see what options there are. If you need help, feel free to reply to me.

2 Likes

i had to change it to 2019

For me, on Visual Studio 2017, the folder of VsDevCmd.bat is \BuildTools\ . not \tools\
on Visual Studio 2019 is \Tools\.

Im Know because i’m try to install vs2017 and vs2019

Your solution works perfectly! Thanks a lot!

Privacy & Terms