Sign in to follow this  
Followers 0
anchorsaway

Closing Winzip

5 posts in this topic

I am very new to autoit and need some help. I am executing WinZip to extract a file. It takes about 3 minutes to extract the file. How do I figure out when the file is done extracting to close WinZip?

Code sample

Func _ExtractWinZipFile($sFileName)

Run("C:\Program Files\WinZip\WINZIP32.EXE")

WinWaitActive("WinZip")

;Close Tip of the day if it is open

ControlClick("WinZip Tip of the Day", "Did you know...", 2 )

;Open the Archive

Send("!f")

Send("{DOWN}")

Send("{ENTER}")

;Types the file name you want to unzip

send("C:\oracle client\" & $sFileName)

Send("!O")

;Extracts the Files to the specified directory

WinWaitActive("WinZip - " & $sFileName)

Send("+e")

WinWaitActive("Extract - C:\oracle client\" & $sFileName)

Send("C:\oracle client")

WinWaitActive("Extract - C:\oracle client\" & $sFileName)

ControlClick("Extract - C:\oracle client\" & $sFileName, "E&xtract to:", 1 )

Need help here:

if i try to close winzip now the command will execute before the extraction is finished

EndFunc

Share this post


Link to post
Share on other sites



Never mind - i figured it out.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

That was basically a really polite way of saying 'please share your solution with the rest of us', anchorsaway! :">

Edit: And welcome to the forums. ;)

Edited by LxP

Share this post


Link to post
Share on other sites

Just added a loop

$x = FileExists("C:\oracle client\client\welcome.html")

While $x = 0

Sleep(5000)

$x = FileExists("C:\oracle client\client\welcome.html")

WEnd

WinClose("WinZip - "& $sFileName, "")

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