Why PATH variable changes are diminished when "command" window is closed?

I have HP i5 Laptop running Windows 7 64 bit.

I open the command window and change path as follows:

PATH C:\MinGW\bin;%PATH%

Surely! value of PATH is changed but when I close command prompt window, change is disappeared.

How do I retain PATH changes?
Who is Participating?
jkrConnect With a Mentor Commented:
PATH is only vaiid throughout a session (of a program or as in your case, a console), like any environment variable. If you want to persistently change that, open the Control Panel, go to "System" (or right-click on "My Computer" and choose "Properties"), then select "Advanced Settings". A tab will open that has a button labeled "Environment Variables..." in the lower half. Pres that button and set PATH in the upcoming dialog by clicking "New". Then select PATH from the "System Variables" and add 'C:\MinGW\bin' to the already existing PATH.
Steve KnightConnect With a Mentor IT ConsultancyCommented:
You are changing the path variable in that cmd session only, and only for that user, this isn't DOS or Windows 9x like behavious but has been this way in all the Windows NT upwards (as opposed to Dos/Win 3.1x/95/98 etc.)

You need to change in "Advanced system settings", right click properties of my computer, then click on the environment variables section:

Environment variables
aadihConnect With a Mentor Commented:

From the Start Menu, right-click Computer; in the window that opens, select Advanced system settings; select Environment Variables; change the Path variable here; and it will be permanent.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.