Jump to content

EnvSet + EnvUpdate not setting Env variables permanently.


sabu
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...