Re: Parse current IP address into environment variables
- From: "Al Dunbar" <alandrub@xxxxxxxxxxx>
- Date: Tue, 31 Mar 2009 22:34:06 -0600
"James Whitlow" <jwhitlow.60372693@xxxxxxxxxxxxx> wrote in message
news:evGf$nisJHA.528@xxxxxxxxxxxxxxxxxxxxxxx
"Pegasus [MVP]" <news@xxxxxxxxxxxxx> wrote in message
news:%23nT9JNisJHA.2776@xxxxxxxxxxxxxxxxxxxxxxx
Each process inherits its environmental variables from its "parent". When
a process terminates then the "child" variables are discarded. To set an
environmental variable from within a VB Script would therefore make
little sense - unless you used a specialised tool that sets the master
environment. Even then you would see the result only in processes that
you launch *after* running your script. Processes that were launched
*before* would be unaware of this variable.
I have had good luck using volatile environment variables. They are still
not visible to processes that were launched before the script, but they
are visible to both new and child processes launched after the script. I
have only tried this in WinXP Pro, so I don't know if this is true in
other versions of Windows.
If I understood the OP correctly when he said "and using them to "write" the
information into several files upon the first boot of a system", he would
seem to need those volatile environment variables to remain through a
reboot.
/Al
Set oWSH = CreateObject("WScript.Shell")
oWSH.Environment("volatile").Item("MyVariable") = "Hello"
.
- Follow-Ups:
- Re: Volatile variables
- From: James Whitlow
- Re: Volatile variables
- Prev by Date: vbscript WINS and DNS
- Next by Date: Re: Parse current IP address into environment variables
- Previous by thread: vbscript WINS and DNS
- Next by thread: Re: Volatile variables
- Index(es):
Relevant Pages
|