When I update my PATH using either the built-in Environment Variables dialog, or something like Path Editor, and then open up a command-prompt, the changes to my PATH will not register with the console, depending on where the command-prompt was started from.

For example, if I edit my PATH and then start cmd.exe from the Start Menu or a shortcut on the Desktop, then my PATH looks fine: it has successfully been updated; however, if I start cmd.exe from a shortcut anywhere other than the Start Menu or Desktop, the new PATH does not get read and I get the old path instead. It's very strange.

I've tried running the command prompt from a shortcut on the desktop and it works fine; I then copy that exact same shortcut to a sub-folder on the desktop, and I get the non-updating PATH problem.

I realise this is quite hard to explain, so I created a screencast to show this issue in action. Site is dead.

Here's a screenshot of the Command Prompt shortcut as seen in that screencast:

Command prompt shortcut settings

This is on Windows Vista Home Premium SP2.


When you start a new process (such as a new command line), it will pick up the environment variables from the process that is starting it. When the path is updated, only the process performing the update can know it has changed, and the setting doesn't propagate until you log back on (for per-user settings) or reboot (for system-wide settings)

  • 4
    However, the main explorer process will detect environment changes in Registry (the dialog box belongs to rundll32) and update its own environment automatically. (At least in XP it does so.) This is why changes are visible when starting cmd from a shortcut.
    – user1686
    Feb 11 '10 at 13:47
  • Rowland, this provided me with enough information to troubleshoot exactly why this was happening, although it didn't answer my question entirely. See my own answer for details. Thanks! Feb 11 '10 at 13:50
  • Thanks for this answer! All I had to do was close my command prompt and open it again. Feb 4 '14 at 17:24
  • This was the solution for me! I am using Git Bash for Windows within a multitab wrapper (ConEmu) and wondered why echo $PATH wasn't working. I assumed it would be fresh but didn't come out right until I closed all Git Bash tabs and ConEmu. Apr 5 '18 at 15:26
  • if closing your command prompt and reopening it doesn't work, try restarting explorer.exe via task manager. that worked for me. Oct 3 '20 at 3:19

As Rowland suggests, when starting a new process, it will read the environment variables from the process that is starting it. Therefore, when starting a command-prompt from the Start Menu or the Desktop, it reads the environment variables from explorer.exe which, as grawity suggests, detects changes to environment settings in the registry and thus I see my new PATH in command-prompts started from the Desktop or Start Menu.

The reason I do not see updates to my PATH in the screencast I posted is because I had initially launched an explorer window using FARR making FindAndRunRobot.exe the parent process. FARR doesn't automatically detect environment changes and so, child processes spawned from it do not pick up the new PATH. I also had 'Launch folder windows in a separate process' option set in Explorer which means that all explorer.exe windows I opened subsequent to the initial one opened by FARR where also children of FARR.

By turning-off the 'Launch folder windows in a separate process' option, new explorer.exe processes aren't created under FARR, which solves my problem. However, I also launch console windows and other things directly from FARR; these also get the old environment settings. If I restart FARR, then the new environment settings are propagated.

Here's a screenshot of Process Explorer showing processes spawned from FARR. None of these processes receive the new environment settings from the top-level explorer.exe unless I restart FARR:

process explorer

  • 4
    Why was my answer voted down? If there is a flaw in it, let me know and I'll try to fix it. May 14 '10 at 10:50
  • make great sense.
    – engineer
    Nov 6 '14 at 3:16
  • Charles, perhaps because it would have been better to explicitly correct the Q's inaccurate "if I start cmd.exe from a shortcut anywhere other than the Start Menu or Desktop, the new PATH does not get read".
    – ChrisJJ
    Feb 2 '20 at 23:27

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.