Jump to content

Auto confirm pop-up Window


Recommended Posts

Autoit is a bit new for me but I'm wondering if this is possible (maybe you can also tell me how).

As an Administrator I have to deal with an installation. This installation takes very long (almost 3 hours) and the only thing I need to do is install the first steps and then wait for maybe 100 pop-up windows and press the "ok" button or just hit Enter for each window.

Do you think it would be possible to write a small app that just presses the OK button or hits enter when the pop-up window appears on the screen? Any help would be nice! Thanks!

Link to comment
Share on other sites

Here is par of a script I use for program installatio. It runs a loop that checks if a certain window is shown and performs a specific action. The last step, once complete jumps out of the loop.

This is not really a working example as it was culled from a large script, but will be a good starting point for you. The most useful functions used are 'ControlClick' and 'WinActive'. Look these up in the help. Use the 'AutoIt Window Info' program to determine the button names or window text. This is in the AutoIt start menu.

Personally, I would not use MouseClick or Send, the 'ControlClick' is the way to go.

$ThisIsLastWindow = 0
$SetupTitleBarName = "Blah Blah Setup"

While 1
    
    Sleep(500)
    
; Welcome Screen
    $WindowText = "Welcome to the"
    If WinActive($SetupTitleBarName, $WindowText) Then
    ; Click 'Next' button
        ControlClick($SetupTitleBarName, $WindowText, "&Next >")
    EndIf
    
; 'License Agreement' Screen
    $WindowText = "License Agreement"
    If WinActive($SetupTitleBarName, $WindowText) Then
    ; Click 'I accept' button
        ControlClick($SetupTitleBarName, $WindowText, "Button1")
    ; Click 'Next' button
        ControlClick($SetupTitleBarName, $WindowText, "&Next >")
    EndIf
    
; 'Ready to Configure' screen
    $WindowText = "Click Install to begin the installation."
    If WinActive($SetupTitleBarName, $WindowText) Then
    ; Click 'Install' button
        ControlClick($SetupTitleBarName, $WindowText, "&Install")
    EndIf
    
; 'Setup Complete' screen
    $WindowText = "Setup Complete"
    If WinActive($SetupTitleBarName, $WindowText) Then
    ; Click 'Next' button
        ControlClick($SetupTitleBarName, $WindowText, "Finish")
        $ThisIsLastWindow = 1
    EndIf
    
;Quit loop if the previuos window the installer will raise
    If $ThisIsLastWindow = 1 Then ExitLoop
    
WEnd

“Give a man a script; you have helped him for today. Teach a man to script; and you will not have to hear him whine for help.”AutoIt4UE - Custom AutoIt toolbar and wordfile for UltraEdit/UEStudio users.AutoIt Graphical Debugger - A graphical debugger for AutoIt.SimMetrics COM Wrapper - Calculate string similarity.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...