Sign in to follow this  
Followers 0
tijiez

Using Environment Variables In INI File

4 posts in this topic

Is there a way to read %tmp%\file.ext from an INI file in a way that AutoIt will understand it as @TempDir?

For Example:

If I used iniread of file (from below) and my string was equal to "%tmp%\file.ext", how could I then do FileDelete() on that string. It's not understanding %tmp% as the temporary directory...

[sECTION]

File=%tmp%\file.ext

Share this post


Link to post
Share on other sites



Opt('ExpandEnvStrings', 1)

Share this post


Link to post
Share on other sites

Go figure that it was something ridiculously easy. I was scouring the help file in all of the wrong places. Now I'm embarrassed. :)

Share this post


Link to post
Share on other sites

Although, just be aware that it will then expand env variables for the rest of the script. In other words, if you needed to actually enter any string text with two % symbols such as "%tmp%" it will now treat it as an expandible variable nomatter what. You'd have to work around that if you needed to use it in a string elsewhere. (ex. "%" & "tmp" & "%")

Just FYI.

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  
Followers 0