I often open the command prompt from a folder in Windows Explorer by typing cmd + ENTER:

enter image description here

I noticed that by doing so, if I have changed something in my environment variables (e.g. PATH, through System properties ==> Advanced system settings ==> Environment Variables) after I opened the Windows Explorer window but before I opened the command prompt, then when I open the command prompt, my modifications in environment variables are not present. E.g. if I open a Windows Explorer window, change PATH to change my Python interpreter, then open a command prompt from the Windows Explorer window, my Python interpreter has not changed. It works fine if I open the command prompt through Start -> Run -> cmd though.

Why, and is there anyway to fix this behavior?

  • 3
    It's because explorer received its environment list from the system at the time it was started. Unfortunately, the same explorer also manages the desktop, so you cannot simply exit and restart: you need to kill the process completely, which has some side-effects you may not like. The only work-round is to use one of the many explorer alternatives, which can easily be restarted; or of course to run from Start -> Run, as you have found, – AFH Aug 9 '15 at 0:47
  • well, change the habit, click start then cmd<ENTER> – barlop Aug 9 '15 at 2:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.