jasochen

How to close Windows Systems PopUp MsgBox

4 posts in this topic

Hi,

I'm newbie of Autoit, and trying to develop an automation tool on Windows.

Now the problem is, When I trying to do some operation on an Windows application, message box popup with error info, and it block the autoit script.

Is there any ways to close the popup msgbox within the script?

I tried many ways including the Timer, like:

Func MsgBoxDemo()
    $infoWnd = SplashTextOn("splash", "message", -1, -1, -1, -1, $DLG_TEXTVCENTER, "", 24)
    _Timer_SetTimer($infoWnd,3000,"FireMsg")
    MsgBox($MB_SYSTEMMODAL, "test", "demo1")
EndFunc


Func FireMsg($hWnd, $iMsg, $iIDTimer, $iTime)
    $errorWnd = WinActive("test")
    If $errorWnd <> 0 Then
        Send("{ENTER 1}")
    EndIf
EndFunc

 

It works for above example, but not in the real case,  it seems the MsgBox block the timer too.

I'm not sure whether it's about the MsgBox modal type..

 

Can any experts help on this?

 

Thanks

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!
Which application do you try to automate? Most of the time there are more reliable ways to do what you want to do.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hello water,

I want to automated the License Installation of License server Manager on Win2008 Server.

If an invalid license code been given, the error msgbox shown and what I want is to close it and continue.

Share this post


Link to post
Share on other sites

You could run Slmgr.vbs silently as described here:
https://social.technet.microsoft.com/Forums/sharepoint/en-US/799115b2-4fda-4c53-b518-684c009edac6/run-slmgrvbs-silently
Example:

cscript //B "%windir%\system32\slmgr.vbs" /ato

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

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