environment variables and syncing it 
Author Message
 environment variables and syncing it

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.



Wed, 23 Jul 2003 11:24:30 GMT  
 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.



Wed, 23 Jul 2003 13:02:17 GMT  
 environment variables and syncing it
But this will not make "myvar" persistent.  I cant see if once the
dialog box is done.  How to make available even after boot of the
machine



Quote:
>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.
>--



>> 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.



Wed, 23 Jul 2003 14:05:50 GMT  
 environment variables and syncing it
It was just a demo...  

Take out the ---> UserEnv.Remove("myvar")

It was in there just so I didn't leave any trash behind ;-)...

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> But this will not make "myvar" persistent.  I cant see if once the
> dialog box is done.  How to make available even after boot of the
> machine



> >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.
> >--



> >> 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.



Wed, 23 Jul 2003 14:20:24 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. environment variables: wshshell.environment or wshshell.expandenv ironmentstrings?

2. Creating and environment variable and using it in the same cmd window

3. Environment variables in postscript templates

4. Getting Environment Variables

5. Environment Variables

6. Using RedMon environment variables to get original Document Name

7. Environment Variable Reporting

8. Environment variables

9. Get Environment Variables from NT Server

10. Accessing Environment Variables from DHTML?

11. Environment Variables in Outlook agent

12. Client PC Environment Variables

 

 
Powered by phpBB® Forum Software