I need to understand how Global vs User variables works in windows.
Case 1: If the same variable is defined at user and global section what is the behaviour? E.g. I have defined a %PATH% variable either in user and global sections and I see only global value; is there a way to 'append" user PATH to global PATH?
The variables defined in user section are not 'resolved' in global section. If I use
SET command I see a list of all defined variables (user and global) but 'cross references' are not resolved.
in user section I define:
in global section I define:
SET I see:
... VAR1=test-user VAR2=%VAR1%-more;test-global-more VAR3=test-global ...
I'm on a Windows 7 x64 box.
So, based on the tests above, my conclusions are:
- global variables override user variables (if the name is the same only global is valid)
- no cross reference is admitted between user and global variables
Am I right?