Unexpected retrieved value in Environment Varaibles
- From: Marten <absolute88@xxxxxxxxxxx>
- Date: Tue, 25 Mar 2008 14:50:16 -0500
I'm getting mixed and unexpected values when trying to retrieve an
environment variable I had created. Hopefully someone can see what
I've missed.
From code I've found in the forums, I've pieced together a quick anddirty little hardware inventory script that I call from the main login
script. (All the scripts are VBS.)
In the main script I set an environment variable indicating which
office the user is connecting from.
objWSS.Environment("VOLATILE")(EnvVarName) = EnvVarValue
where for example EnvVanrName = "Location" and EnvVarValue =
"Toronto".
The invenory routine retrieves the environment variable with
getEnviroVar = objShell.ExpandEnvironmentStrings("%" & EnvVar
& "%")
and writes it to a text file. One file per user login. The file gets
replaced each time the user logs in. Items are TAB delimited.
I then have a third vbs script that opens all the little text files
and inputs the ReadLine into an Excel spread***.
Everything looks great. Except that darn office indicator.
Some desk give the location and some give the variable:
WPGENGDPETER-S Microsoft Windows XP Professional Intel(R)
Pentium(R) 4 CPU 3.00GHz Winnipeg
WPGAGEDKAREN-H2 Microsoft Windows XP Professional Intel(R)
Pentium(R) D CPU 3.40GHz %MCWlocation%
Anyone have any ideas?
Marten
.
- Follow-Ups:
- Re: Unexpected retrieved value in Environment Varaibles
- From: Pegasus \(MVP\)
- Re: Unexpected retrieved value in Environment Varaibles
- Prev by Date: Re: VB Script for Reading from CSV file
- Next by Date: Re: Extracting data from an XML to put into a constant
- Previous by thread: port status
- Next by thread: Re: Unexpected retrieved value in Environment Varaibles
- Index(es):