Jump to content

It's supposed to be simple, extract a file in a different directory than @ScriptDir

Recommended Posts


I have read every dang RUN doesn't work, Comspec is not working, tried almost all of the samples, for comspec. and all the Run and Runas. Shellexecute series. 

Now I am now a expert at getting any extract to extract in the @ScriptDir, no matter where you really want it to go.

But alas there is not much call for that,, 

Google, Yahoo Groups. autoit-script.ru/ and even forum.autoitbrasil.com/ i find my answers, Yet it evades me.

#include <ButtonConstants.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <File.au3>
DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1) ; This disables 32bit applications from being redirected to syswow64 instead of system32 by default ;
;;;FileInstall("setup2a.exe", $sFile55Path)
Local $DefSet6 = IniRead(@ScriptDir & "\Programsettings.ini", "Filepaths", "setgfull", "")
;IniRead(@ScriptDir & "\Programsettings.ini", "Filepaths", "setgfull", $mainfile)
;MsgBox($MB_SYSTEMMODAL, "", "The file exists." & @CRLF & "FileExist $Return returned: " & $DefSet6)
Local $thepath=$DefSet6                                 ;;;  setgdir

;;;  setgfull=C:\Program Files\     $thepath
;;;      setgdir=Goodies  $DirGood=$DefSet3

Local $DefSet2 = IniRead(@ScriptDir & "\Programsettings.ini", "Filepaths", "filename", "")
;IniRead(@ScriptDir & "\Programsettings.ini", "Filepaths", "filename", $main2file)
Local $thefile=$DefSet2


Local $DefSet3 = IniRead(@ScriptDir & "\Programsettings.ini", "Filepaths", "setgdir", "")
;IniRead(@ScriptDir & "\Programsettings.ini", "Filepaths", "filename", $main2file)
;MsgBox($MB_SYSTEMMODAL, "", "The file exists." & @CRLF & "FileExist returned: " & $thefile)
;Local Const $sFile55Path = $thepath&$DefSet3&"\"

 Local $unzio = $thepath&$DirGood&"\"
MsgBox($MB_SYSTEMMODAL, "", "The file exists." & @CRLF & "$sFile55Path returned: " & $unzio)
 ; EnvUpdate ;;
;  RunWait($sFile55Path&"setup2a.exe")
 ;  FileInstall("setup2a.exe", @ScriptDir)
 ;FileInstall("setup2a.exe", $sFile55Path)
;MsgBox($MB_SYSTEMMODAL, "", "The file exists." & @CRLF & "$sFile55Path returned: " & @ScriptDir)
 ;EnvSet("MYVAR", $sFile55Path)
  ; RunWait("setup2a.exe")
    ; Retrieve the environment variable that was just assigned a value previously.
;    Local $sEnvVar = EnvGet("MYVAR")
; EnvUpdate
;    RunWait("setup2a.exe")
;FileInstall("setup2a.exe", $sFile55Path)
; RunWait($sFile55Path&"setup2a.exe")
;;RunWait(@ComSpec & " /k ""'7z.sfx& setup2a.exe " &$sFile55Path ,1 )
;;FileInstall("TIH17_19a.7z", $sFldr1)


I thought my latest attempt would do the trick.

;;; setgfull=C:Program Files $thepath
;;; setgdir=Goodies $DirGood=$DefSet3 

I reset the variables to the directory with setgfull

and the sub directory with setdir

the in a fit of anticipation I validate it with

Local $unzio = $thepath&$DirGood&""

MsgBox($MB_SYSTEMMODAL, "", "The file exists." & @CRLF & "$unzio returned: " & $unzio)

and it validates perfectly. So i go in for the victory with


and don't you know.. it works perfectly, running the self extractor setup2a.exe that is in the @ScriptDir and was copied to the C:Program FilesGoodies so you would think, that running RunWait($unzio&"setup2a.exe")

in what I think is the C:Program FilesGoodies would work.,. but it extracts it into the @ScriptDir.
Yes the code's a mess, I have been at this for a week now, and delete it and try again and again, and broke down and beg for help to figure out what i am doing wrong.  


Share this post

Link to post
Share on other sites

OK.. so I am a mess.. but I got the answer.. I was just brain dead for a spell..

here is the fix,

RunWait($unzio&"setup2a.exe", $unzio, @SW_HIDE)

The answer is to add the working directory. DUH ! !!!

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


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.