cheeroke Posted July 8, 2016 Posted July 8, 2016 I dont know how to make this working or I am missing something - maybe in `#include` ? at this point I have: #RequireAdmin #include <MsgBoxConstants.au3> #include <FileConstants.au3> ;vcdredist Run($sDrivers & "\vcredist_x86.exe") WinWaitActive("vcredist_x86") ;ControlClick("Microsoft Visual C++ 2010 x86 Redistributable Maintenance", "","[CLASS:Button; INSTANCE:3]") ControlClick("Microsoft Visual C++ 2010 x86 Redistributable Maintenance", "","[ID:105]") I've checked with AutoIt v3 WIndow Control and arguments inside ControlClick are correct none of last two lines make AutoIt select desired option. Any help very much appreciated.
AutoBert Posted July 8, 2016 Posted July 8, 2016 I think the problem is the WinWaitActive, try #RequireAdmin #include <MsgBoxConstants.au3> #include <FileConstants.au3> ;vcdredist Run($sDrivers & "\vcredist_x86.exe") WinWaitActive("Microsoft Visual C++ 2010 x86 Redistributable Maintenance") ConsoleWrite('Found'&@CRLF) ;ControlClick("Microsoft Visual C++ 2010 x86 Redistributable Maintenance", "","[CLASS:Button; INSTANCE:3]") ControlClick("Microsoft Visual C++ 2010 x86 Redistributable Maintenance", "","[ID:105]")
cheeroke Posted July 8, 2016 Author Posted July 8, 2016 9 minutes ago, AutoBert said: I think the problem is the WinWaitActive, try #RequireAdmin #include <MsgBoxConstants.au3> #include <FileConstants.au3> ;vcdredist Run($sDrivers & "\vcredist_x86.exe") WinWaitActive("Microsoft Visual C++ 2010 x86 Redistributable Maintenance") ConsoleWrite('Found'&@CRLF) ;ControlClick("Microsoft Visual C++ 2010 x86 Redistributable Maintenance", "","[CLASS:Button; INSTANCE:3]") ControlClick("Microsoft Visual C++ 2010 x86 Redistributable Maintenance", "","[ID:105]") ...still doesn't work
cheeroke Posted July 8, 2016 Author Posted July 8, 2016 ...ups, how to run console? is it cmd? or AutoIt console - if so - how to run it?
AutoBert Posted July 8, 2016 Posted July 8, 2016 I mean the Scite4AutoIt Console. But just replacing ConsoleWrite('Found'&@CRLF) with MsgBox(0,'Window','is activated') will give you same feedback.
cheeroke Posted July 8, 2016 Author Posted July 8, 2016 7 minutes ago, AutoBert said: MsgBox(0,'Window','is activated') I've replaced with above but no message pop-ups.
AutoBert Posted July 8, 2016 Posted July 8, 2016 Than the WinWaitActive didn't find the window and is still waiting. Correct the Windowstitle in this line.
water Posted July 8, 2016 Posted July 8, 2016 You could use command line switches to silently install the program. Then there would be no need to automate the GUI.https://blogs.msdn.microsoft.com/astebner/2010/10/20/mailbag-how-to-perform-a-silent-install-of-the-visual-c-2010-redistributable-packages/ My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.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 (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
cheeroke Posted July 8, 2016 Author Posted July 8, 2016 Very helpfull, thanks. I got another question, how to run batch file but may i ask here or shall i create new topic?
water Posted July 8, 2016 Posted July 8, 2016 To run a batch file use Run, RunWait or ShellExecute. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.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 (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
cheeroke Posted July 8, 2016 Author Posted July 8, 2016 if i want to run it like when you right click on file and run as administrator?
cheeroke Posted July 8, 2016 Author Posted July 8, 2016 .... RunAS seems to have too many options which i dont need RunAs ( "username", "domain", "password", logon_flag, "program" [, "workingdir" [, show_flag [, opt_flag]]] )
water Posted July 8, 2016 Posted July 8, 2016 Add "#RequireAdmin" to your script and then use "Run" to run the batch file. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.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 (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
cheeroke Posted July 8, 2016 Author Posted July 8, 2016 1 minute ago, water said: Add "#RequireAdmin" to your script and then use "Run" to run the batch file. did that already but it doesn't work
cheeroke Posted July 8, 2016 Author Posted July 8, 2016 There are some hidden files which i think are being trigged by script - would it be the case it doesn't work? (sorry i dont know how to edit my own post)
water Posted July 8, 2016 Posted July 8, 2016 What do you mean by hidden files? Run exactly starts the file you specify. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.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 (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
SadBunny Posted July 8, 2016 Posted July 8, 2016 Maybe the batch file requires files in the directory of that batch file. Try adding the directory as the second parameter to the Run command as follows: Run("c:\tmp\myDirectory\xyz.bat", "c:\tmp\myDirectory") Roses are FF0000, violets are 0000FF... All my base are belong to you.
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