Sign in to follow this  
Followers 0
ezzetabi

Refresh Dos Variables?

3 posts in this topic

#1 ·  Posted (edited)

I have a problem...

Try making this script

RunWait,setx ANEWVARIABLE ANEWSET,,hide
MsgBox,0,...,The ANEWVARIABLE set should contain " %ANEWVARIABLE% "

;But it doesnt :(

RunWait,setx ANEWVARIABLE "",,hide

If you start a %comspec% /k set command while the msgbox is there you'll see the set active...

Why cant I use it in autoit? There is a way to refresh the dos variables to use them?

Of course you need the SETX program.

Edited by ezzetabi

Share this post


Link to post
Share on other sites



For those who are not familiar with Setx.exe ...

This command-line tool offers a batch method for setting environmental variables in the user or system environment and requires no programming or scripting. In addition to taking an environmental variable and its associated value from the command line, it can also get the values of registrykeys and write them to text files.

SetX provides the only command-line or programmatic way to directly set system environment values for Microsoft Windows 2000. System environment variables are manually configureable through Control Panels or through a registry editor (Regedit or Regedt32). The SET command, which is internal to the command interpreter (Cmd.exe), sets only user environment variables for the current console window.

You can use SetX to set values for user and system environment variables from one of three sources: Command Line Mode, Registry Mode, or File Mode.

Webpage

Download

-----

And this won't run ???

RunWait, %COMSPEC% /C <Mypath>\\setx.exe <MyNewVariable> <MyNewSet>,,hide

Share this post


Link to post
Share on other sites

No... Already tried...

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0