Jump to content

How to close Windows Systems PopUp MsgBox


Recommended Posts

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

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 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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 2021-06-05 - Version 1.5.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-06-14 - Version 1.6.5.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...