MrChris Posted July 7, 2006 Posted July 7, 2006 (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 July 7, 2006 by MrChris
Briegel Posted July 7, 2006 Posted July 7, 2006 (edited) This will work... DirCreate(@TempDir & '\data') FileInstall("c:\daten\test.bat", @TempDir & '\data\test.bat',1)oÝ÷ Ú (v[@ÈMEqÇè® -Ó~¯j´¨«Þ$jëh×6$var = @TempDir & '\data' DirCreate($var) FileInstall("c:\daten\test.bat", $var & '\test.bat',1) Edited July 7, 2006 by Briegel
MHz Posted July 7, 2006 Posted July 7, 2006 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
MrChris Posted July 7, 2006 Author Posted July 7, 2006 Ahhhhh now it makes a little more sense. Thanks a ton. MrChris
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now