Reputation: 1119
Each process in Windows has its own Environment Variables. But I am not sure how does a process gets its Environment Variables, does it get them from the "global Environment Variables" that Windows provides, I mean those Environment Variables:
Or does it inherit them from its parent process (and only the first parent process gets its Environment Variables from Windows)?
Upvotes: 4
Views: 3861
Reputation: 32240
As stated in Environment Variables (Windows), a child process inherits all environment variables from its parent process. Additionally, a parent process may use CreateProcess to create a child process and pass a new set of environment variables to it.
Apart from that, programs that are started by the command processor (CMD) inherit the CMD environment variables, which are also listed in the screenshot you attached to your question.
Upvotes: 4