
environment variables and syncing it
Set Shell = CreateObject("WScript.Shell")
Set UserEnv = Shell.Environment("USER")
UserEnv("myvar") = "hello"
msgbox "go check in a *new* console window" & vbcrlf _
& "using --> echo %myvar%"
UserEnv.Remove("myvar")
--
Michael Harris
Microsoft.MVP.Scripting
--
Please do not email questions - post them to the newsgroup instead.
--
Quote:
> Hello:
> In NT, I use the environement vairables dialog to set env
> variables. As soon as I set it, it is immediately available to all
> the apps. If I open a new dos window it is available. I call this
> process SYNCING.
> The env. variable is in a specific branch in the registry. If I
> create a new entry, it shows up in the env dialog, but it is not
> available in a command line session.
> How do I create an entry so that an environment variable is not only
> available but is so without a reboot ?
> Can I add a regentry and then expect it to be available after a reboot
> If I am not clear, I can give example.
> Thanks
> -Narahari.