Dr John Stockton wrote:
But can Environment variables be written from these
languages? To do it in Pascal, I had to work low-level.
Far from being a WSH specialist I'm afraid I cannot give you as a
definite answer about this as I'd like to. Still, some quick lookup in
the archives yielded the two following articles, which might be of
interest for you:
<URL:http://groups.google.com/groups?hl=fr&lr=&ie=UTF-8&oe=UTF-8&selm=e52812c2BHA.2588%40tkmsftngp07>
<URL:http://groups.google.com/groups?hl=fr&lr=&ie=UTF-8&oe=UTF-8&selm=3F54F46F.59CADE82%40hydro.com>
The quick story is that you can set environment variables via WSH,
though the way you do it depends on which platforms you set the
variable, and whether you want to set it permanently.
var System=Script.CreateObject("WScript.Shell").Enviro nment("SYSTEM");
System("foo")="bar";
WScript.Echo(System("foo"));
....should work on win2k/XP and make the variable available to other
processes/users. Using "USER" instead of "SYSTEM" makes it available to
the current user only, and using "PROCESS" makes it available to the
current process only.
Windows 95/98 only support "PROCESS", so you cannot make the variable
permanent unless using the "winset" utility.
HTH
Yep.