Sign in to follow this  
Followers 0
jsisson01

WinwaitClose Not Working for me

7 posts in this topic

Hi all, I thought I had this finished, but the WinWaitClose command I had which was working originally is now not working, can anybody help me out?

Func MSDEButton()
  Run("sql70ins.bat")
    WinWaitClose("%SystemRoot%\system32\cmd.exe", "%SystemRoot%\system32\cmd.exe")
    Sleep(3000)
  Run("sql70sp4.exe")
    WinWaitActive("Installation Folder")
    ControlClick("Installation Folder", "Finish", 12325)
    WinWaitActive("PackageForTheWeb")
    ControlClick("PackageForTheWeb", "&Yes", 6)
    WinWaitActive("PackageForTheWeb")
    ControlClick("PackageForTheWeb", "OK", 2)
    WinWaitClose("PackageForTheWeb")
  Run("C:\70SP4\setup.bat", "C:\70SP4\")
EndFunc

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

try this one:

WinWaitClose(envget("systemroot") & "\system32\cmd.exe","")
MsgBox(64,"Gone","CMD.EXE's window has vanished")

regards, Rudi.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

or use the macro:

Of course the macro is the easier way. I just wanted to point out that environment variables have to be resolved using envget() :)

So finally the suggestion for reading up help files and FAQ (sticky postings topmost in this forum) has to be mentioned. :hint:

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

It still doesn't seem to be working correctly, the script still moves into the next install without waiting for the other window to close.

Would it have anything to do with the installer being in silent install mode? I'm not sure, but I'm just venturing a guess.

Edited by jsisson01

Share this post


Link to post
Share on other sites

It still doesn't seem to be working correctly, the script still moves into the next install without waiting for the other window to close.

Would it have anything to do with the installer being in silent install mode? I'm not sure, but I'm just venturing a guess.

How about using the process ID instead of the window title:
Func MSDEButton()
  Local $PID = Run("sql70ins.bat")
    Sleep(1000)
    ProcessWaitClose($PID)
    Sleep(3000)
    
    ; ...
    
EndFunc

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

How about using the process ID instead of the window title:

Func MSDEButton()
  Local $PID = Run("sql70ins.bat")
    Sleep(1000)
    ProcessWaitClose($PID)
    Sleep(3000)
    
    ; ...
    
EndFunc

:)

That one did it! Thanks! That should fix my other issues too :)

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