Home » Questions » Computers [ Ask a new question ]

Why are changes to my PATH not being recognised?

Why are changes to my PATH not being recognised?

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.

Asked by: Guest | Views: 339
Total answers/comments: 1
Guest [Entry]

"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:"