Windows 10 Why doesn't CMD inherit environment variables on this machine?

  • Thread starter Thread starter Code Grump
  • Start date Start date
C

Code Grump

Guest
For whatever reason, my cmd process doesn't inherit its environment variables from the parent process which launched it. Instead it reverts back to the "default" environment settings, like it was launched via explorer.

A simple way to demonstrate this is to open a command-prompt and then run the following:

set Path=C:\Windows\System32\

This will give that session a new path environment. Then launch a child process using the following:

cmd


In the new promp you can then use the following to see the value of the environment variable:


set Path

It should be C:\Windows\System32 (inherited from the launching process) but on my machine it's reverted back to my environment default.


You should see something similar to:

1510239.png

What I see:


1510240.png


More...
 
Back
Top