Tech Community Live: Windows edition
Jun 05 2024, 07:30 AM - 11:30 AM (PDT)
Microsoft Tech Community

Windows 11 environment variables related doubts

Copper Contributor

Hello there! My name is Thiago Chaves, I'm a software engineering student.


I wanted to make my VS Code to run C in its terminal, so a followed this website steps C++ programming with Visual Studio Code, mainly because it's a official tutorial from Visual Studio. I downloaded MSYS2 in my computer and followed all the steps until the "Check your MinGW Installation" section. I went to my terminal and checked that neither gcc, g++ or gdb were there. 


The problem is: when I was configuring the Environment Variables, at the "User Variables", I erased the Path variable and paste the "C:\msys64\mingw64\bin" directory the website was telling me to. And now that I couldn't install MinGW rightly (I think), I thinking of uninstalling ans installing the MSYS2 again, but what will happen to the variable Path if I do this? If so, how can I solute this problem? 


I'm no specialist in operacional systems config at all, so I need a lot of your help ;-;

1 Reply

The entry might get removed, everything else will stay the same.

I'm assuming that everything up until installing MinGW went correctly.


When changing your 'path' variable, whether you put it in user or system doesn't matter.

Unless you're planning to share the computer / laptop with others.

Do make sure that you're changing your path, and not your gopath; those are different.

Either dubbelclick the row, or select it and press 'Edit', it's the second button.


Schermafbeelding 2023-06-04 175828.png

When you're in the path menu, add a new one containing the path to your installation.

By default, this is C:\msys64\mingw64\bin unless you've changed the installation directory.

Mine is different because I like to be special.

You can always browse and check it out if you're uncertain.


Schermafbeelding 2023-06-04 180405.png

Make sure to restart all shells (terminal, command prompt) and Visual Studio Code.

At this point everything should work. Try this or we'll try something else.