Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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.

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
  • Recently Browsing   0 members

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