Re: Setlocal equivalent by Michael
Michael
Wed May 10 18:56:34 CDT 2006
> Thanks very much for clarifying :-)
> To my surprise changing SYSTEM-vars by script is persisting even
> across reboots a/o sessions.
Just as the SYSTEM environment variables are meant to behave WRT to
persistence across same or different user (same machine) logon sessions and
across machine reboots.
VOLATILE is like SYSTEM cross process (parent/child, child/parent, or
sibling/sibling or event unrelated) except only within an active user logon
session. Any logoff/logon sequence starts VOLATILE over from scratch
regardless of same or different user logon or any intervening reboot.
Think of USER as private per user and persistent, SYSTEM as public (given
user read/write permissions to relevant parts of SYSTEM some of which need
admin permissions) and persistent, and VOLATILE as a hybrid of USER and
SYSTEM less the persistence and permissions since it only lives with a given
user logon session. All three of these are also 2-way between parent/child
(executable) processes because they are persistent (at least within a logon
session for the least persistent VOLATILE).
The PROCESS environment is a merge of at least USER+SYSTEM (and current
state of VOLATILE) plus anything added by the a preceding (or the current)
parent to PROCESS, always transient, and passed as a one way copy from
parent to child. Any PROCESS environment change made by a child is not
exposed to the parent but is to a grandchild that gets a copy of the PROCESS
environent of the preceding child (of the root parent) passed to the
grandchild (assume I am the process in the middle of a
parent/child/grandchild tree - I am my parent's child and the parent of my
child who is my parent's grandchild).
--
Michael Harris
Microsoft MVP Scripting