Jump to content
Sign in to follow this  

ControlClick on Button doesnt work

Recommended Posts


i have a little Problem. 

I want to install a program without user interaction. The installer starts and AutoIT wait for the window to be active, but the button isn´t pushed. 

I used many variants of ControlClick to push it, but nothing worked. I used the Button-ID the name of it and so on.

Actual Source Code:

#include <MsgBoxConstants.au3>

$Title = "Installer Language"

Runas( "administrator" , "domain" , "password" , 0, "path" )
WinWaitActive($Title, "Please select a language.")
WinActivate($Title,"Please select a language.")

ControlClick($Title,"Please select a language.", "OK", "left")

;MsgBox($MB_SYSTEMMODAL, "Title", "This message box will timeout after 10 seconds or select the OK button.", 10)
;ControlClick ($Title, "" ,1 , 75 , 23 )

Au3Info Summary:

>>>> Window <<<<
Title:  Installer Language
Class:  #32770
Position:   813, 501
Size:   294, 157
Style:  0x94C808CC
ExStyle:    0x00010101
Handle: 0x0000000000EA050E

>>>> Control <<<<
Class:  Button
Instance:   1
ClassnameNN:    Button1
Advanced (Class):   [CLASS:Button; INSTANCE:1]
ID: 1
Text:   OK
Position:   113, 96
Size:   75, 23
ControlClick Coords:    41, 12
Style:  0x50010001
ExStyle:    0x00000004
Handle: 0x00000000003E0C12

>>>> Mouse <<<<
Position:   970, 635
Cursor ID:  0
Color:  0xC9EAEA

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Please select a language.

>>>> Hidden Text <<<<

I don´t know what to do. Please help me.

Share this post

Link to post
Share on other sites


Try with just

ControlClick($Title, "", "Button1")
ControlClick("Installer Language", "", "Button1")

Edit: I see that your window has the same class as mine,  Class:   #32770. Not sure if it means anything, just find it interesting that it's the same class for the two windows, and we are both experiencing issues interacting with it.

Edited by AutoDub

Share this post

Link to post
Share on other sites

Dont think you can use Control???? Commands on a program running under different credentials.

Try running the whole script with a runas and use a run() command in the script.


Share this post

Link to post
Share on other sites

@Jos It works. Thank you!

But my problem is, that it has to be runned as administrator and the Users dont have the permission to do that.

Share this post

Link to post
Share on other sites

First reshell your script with the right credentials and then do what you need to do.

You can use a commandline parameter to indicate the seconds stage.


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  

  • Create New...