Jump to content
Sign in to follow this  
sabu

EnvSet + EnvUpdate not setting Env variables permanently.

Recommended Posts

sabu

Friends,

I am setting an environment variable using the EnvSet function followed by the EnvUpdate function. This does not set the environment variable permanently. When I come out of the AutoIt script, the variable retains its original value. How can I permanently set the environment variable from within the AutoIt script?

Sabu

Share this post


Link to post
Share on other sites
eltorro

According to the help file:

A environment variable set in this way will only be accessible to programs that AutoIt spawns (Run, RunWait). Once AutoIt closes, the variables will cease to exist.

So I assume that returning to it's original value also is true.

Without using control panel, it would require reg changes to make the variables permanent:

<code>;system variables
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
;User variables
 </code><code>HKEY_CURRENT_USER\Environment</code>

see here.

Share this post


Link to post
Share on other sites
sabu

According to the help file:

So I assume that returning to it's original value also is true.

Without using control panel, it would require reg changes to make the variables permanent:

<code>;system variables
 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
;User variables
 </code><code>HKEY_CURRENT_USER\Environment</code>

see here.

Thanks, eltorro.

Regards.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.