JCWohlschlag 0 Posted January 12 Share Posted January 12 Hello, everyone. I am pretty new to AutoItScript, having only used it a few times in the last decade. I am trying to automate the install of Draytek Smart VPN Client software (due to it not having any unattented/automated installation controls of its own). I cannot figure out why my script is not able to click the “Next” button in this installation window. SetError(100) WinWait("Smart VPN Client 5.5.1 Setup", "Welcome to Smart VPN Client 5.5.1 Setup") MsgBox(4096, "AutoIt Status", "Draytek window: " & @error, 10) SetError(100) ControlClick("Smart VPN Client 5.5.1 Setup", "&Next >", '[CLASS:Button; INSTANCE:2)') MsgBox(4096, "AutoIt Status", "Next button: " & @error, 10) Both the WinWait and ControlClick functions are resetting @error back to 0, so they are not setting their own error codes of any sort. The Draytek Smart VPN Client installation window just sits there, however, without advancing to the next dialog. Link to post Share on other sites
Luke94 30 Posted January 12 Share Posted January 12 Local $hWnd = WinWait('Smart VPN Client 5.5.1 Setup', '', 5) If IsHWnd($hWnd) = 1 Then If WinActive($hWnd) = 0 Then WinActivate($hWnd) ControlClick($hWnd, '', '[CLASS:Button; INSTANCE:2]') EndIf Does this work? Link to post Share on other sites
ad777 22 Posted January 12 Share Posted January 12 (edited) the problem was --> ) replace it with --> ] ControlClick("Smart VPN Client 5.5.1 Setup", "&Next >", '[CLASS:Button; INSTANCE:2]') if didn't work use class insted: ControlClick("[CLASS:#32770]", "&Next >", '[CLASS:Button; INSTANCE:2]') Edited January 12 by ad777 iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. Link to post Share on other sites
JCWohlschlag 0 Posted January 12 Author Share Posted January 12 22 minutes ago, Luke94 said: Local $hWnd = WinWait('Smart VPN Client 5.5.1 Setup', '', 5) If IsHWnd($hWnd) = 1 Then If WinActive($hWnd) = 0 Then WinActivate($hWnd) ControlClick($hWnd, '', '[CLASS:Button; INSTANCE:2]') EndIf Does this work? It brings the Draytek install window to the front, but does not click the button and advance the dialog. 23 minutes ago, ad777 said: the problem was --> ) replace it with --> ] ControlClick("Smart VPN Client 5.5.1 Setup", "&Next >", '[CLASS:Button; INSTANCE:2]') if didn't work use class insted: ControlClick("[CLASS:#32770]", "&Next >", '[CLASS:Button; INSTANCE:2]') Thank you for catching my typo. Neither fixing that typo nor your other suggestion of using the explicit [CLASS:#32770] argument worked. Installation window sits on that first dialog and the button does not click. Link to post Share on other sites
ad777 22 Posted January 12 Share Posted January 12 you forget to add WinActivate("[CLASS:#32770]") in first line the window shoud be active: your code shoud be: WinActivate("[CLASS:#32770]") Sleep(1000) SetError(100) WinWait("Smart VPN Client 5.5.1 Setup", "Welcome to Smart VPN Client 5.5.1 Setup") MsgBox(4096, "AutoIt Status", "Draytek window: " & @error, 10) SetError(100) ControlClick("[CLASS:#32770]", "&Next >", '[CLASS:Button; INSTANCE:2]') MsgBox(4096, "AutoIt Status", "Next button: " & @error, 10) iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. Link to post Share on other sites
ad777 22 Posted January 12 Share Posted January 12 try this if didn't work: For $i =0 To 1 Step 1 ControlCommand("[CLASS:#32770]", "", "Button2", "check", "") Next iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. Link to post Share on other sites
Danp2 1,221 Posted January 12 Share Posted January 12 Could be an rights issue. Have you tried adding #RequireAdmin at the beginning of your script? WebDriver UDF [GH&S] Latest version Wiki FAQs Link to post Share on other sites
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now