Sign in to follow this  
Followers 0
MrChris

FileInstall to extract to %Temp%\data folder?

4 posts in this topic

#1 ·  Posted (edited)

I need help understanding how to use environment vars in AutoIt currently while im trying to compile a script I want to use FileInstall and I know how to use that but not understanding how to use it when I want the extract path to be the users %temp%\data folder? the data folder will be created when extracting the content. So that later I can use the RunWait function of the extracted file/files!

I tried to read FileInstall and @tempdir and a few others but non give examples with a $var in the FileInstall extract path.

Thanks,

MrChris

Edited by MrChris

Share this post


Link to post
Share on other sites



An example

; Variable is assigned
$var = @TempDir & '\data'

; Create the folder
If DirCreate($var) Then

    ; Extract the file to the folder (trailing backslash used a is a File* function)
    If FileInstall('file.exe', $var & '\') Then

        ; Execute the extracted file
        RunWait($var & '\file.exe')

        ; Remove the directory from the themp folder
        DirRemove($var, 1)

    EndIf
EndIf

:D

Share this post


Link to post
Share on other sites

Ahhhhh now it makes a little more sense.

Thanks a ton.

MrChris

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