I set a user environment variable FOO=bar via the control panel.
I then open 2 cmd windows. The first from the start button, the other from the context (shift+right-click) menu of my working directory, and type echo %FOO%
.
The first prints bar
. The other prints %FOO%
Why are the outputs different & is there a way to access user environment variables from every cmd window?
I'm working on the same problem.
A win-r macro would work but prefer quiet / non-intrusive solution.
I tried by using schtasks /run but it kept the old env.
There's probably a command to launch with the new env.
Nirsoft or sysinternals probably has something...
Still looking.
*** MSalters answered OP correctly, inheritance issue.
The command-prompt-here inherited the explorer's old environment.
Then a new context-menu command-prompt-here should work.