Is there a way to set environment variables for explorer.exe that aren't there when windows is restarted?
I was looking at some of the comments View process environment variables in Windows and they make this interesting point.
They make the point that when you set an environment variable from that/the "Environment variables" window, setting system environment variables there. Then it sets them for the explorer.exe process. Hence, any new cmd window receives them. Because the child cmd.exe process spawned from the parent process explorer.exe inherits those variables. And the reason why when you use the SET command in cmd.exe , it is only for that cmd window, is because it only sets them for that particular cmd.exe process. So, comments there make the point that environment variables are always particular to a process.
When Windows is restarted, the environment variables set in that "Environment variables" window persist, such that when Windows is restarted, they are still there. And I know environment variables set there are written into the registry.
I'm wondering, if it is possible to set environment variables for explorer.exe without them going into the registry and so without them being there after Windows restarts?
Note- I ask in my question "without them going into the registry". So a solution that writes them to the registry then deletes them, is not a solution. SETX is not a solution as SETX is just a command line version of what setting variables in the environment variables window does, and it sets them in the registry. The REG command can also be used to add/remove from the registry https://stackoverflow.com/questions/1472722/how-to-remove-an-environment-variable-from-the-system-configuration-with-a-batch or https://stackoverflow.com/questions/13222724/command-line-to-remove-an-environment-variable-from-the-os-level-configuration But it's not a solution / not what i'm speaking of.