Jump to content

Recommended Posts

Posted

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.

Posted

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]")

 

Posted
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 :(

Posted

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

 

Posted

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

 

Posted

.... RunAS seems to have too many options which i dont need

 

RunAs ( "username", "domain", "password", logon_flag, "program" [, "workingdir" [, show_flag [, opt_flag]]] )

 

Posted

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

 

Posted
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

Posted

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)

Posted

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

 

Posted

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.

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...