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?
LVL 1
naseeamAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve KnightIT 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
0
aadihCommented:
Try:

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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.