- May
- 13,594
- 201
Rex, you probably know more about how CMD works than most persons. I wrote this (below) in another thread. Please comment.
CMD must handle it's environment in a very peculiar way ... perhaps keeping a copy of it and **not** looking at the real environment when you query a variable with "SET varname". I'll start with this in in CMD:
Now I'll use DynamicSetEnvVar (or my PSET) to set CMD's q to 999. Back in CMD I see:
At this point, I can force CMD to update its copy (?) of the environment by (in CMD) setting some other variable!
CMD must handle it's environment in a very peculiar way ... perhaps keeping a copy of it and **not** looking at the real environment when you query a variable with "SET varname". I'll start with this in in CMD:
Code:
C:\Users\vefatica> set q
q=666
C:\Users\vefatica> echo %q%
666
Code:
C:\Users\vefatica> set q
q=666
C:\Users\vefatica> echo %q%
999
C:\Users\vefatica> set q
q=666
Code:
C:\Users\vefatica> set x=0
C:\Users\vefatica> set q
q=999
C:\Users\vefatica> echo %q%
999