Page 1 of 1

Windows 10 cmd prompt seems to start with wrong environment variable values

Posted: Thu Mar 23, 2017 1:20 pm
by gjatkinson
When I boot up in Windows 10, I have a user variable set to path 1. Everything gets kicked off at startup too. When I launch the command prompt from Everything or from anywhere elsewhere, running the 'set' command shows that user variable pointing to path 1. If I change that variable to path 2, and relaunch the command prompt from Everything it has the old environment variable value of path 1 while the command prompt executed from elsewhere shows the correct new path 2.

I feel like I've probably messed something up cause this does not make sense to me. Any thoughts on how to debug this and figure out what's really going on? Or is this a known issue?

Re: Windows 10 cmd prompt seems to start with wrong environment variable values

Posted: Thu Mar 23, 2017 2:47 pm
by therube
I'm not exactly following, but...

Everything should be inheriting variables as there were when everything.exe was executed.

Changes made after that are not re-inherited.

So unless you've restarted Everything after the variable change or unless you've change the variable from within the running instance of Everything (not sure you can do that, & this would have to be within the Everything instance itself, not a child process of that instance), then changes made outside of that running instance of Everything won't be seen by Everything.

SET TEMP=C:\TMP && Everything.exe

If you jump to a prompt - from within everything

ECHO %TEMP%

should show, C:\TMP

---

Now if from that prompt, you change TEMP

SET TEMP=C:\TEMP_DIR

TEMP is changed for that child process, or from processes opened by that child, but TEMP in the parent, Everything, remain unchanged, so there it is still C:\TMP. Likewise if you open a new (second) child prompt from within Everything, that too maintains its original TEMP value, C:\TMP.

Re: Windows 10 cmd prompt seems to start with wrong environment variable values

Posted: Thu Mar 23, 2017 3:53 pm
by gjatkinson
Thank you. That helps me understand what is occurring and allows me to feel comfortable that things are working as expected... maybe not how I want them to work but as expected. Thanks again!