Jump to content

ProcessWait Question


Recommended Posts

  • Built an AutoIT .exe to execute an OS update.exe
  • Using ProcessWait to identify a RUNDLL.exe error that appears during installation.
  • Once the RunDLL.exe appears, the AutoIT.exe script does not perform the ControlClick feature.
  • the AutoIT.exe script is still running in taskmanager, along with the update.exe and rundll.exe
  • and all is halted at this point.

Any ideas, appreciated.

; Execute Update and Suppress All Errors Messages
;====================================================
;Hides the AutoIT icon
Opt("TrayIconHide",1)

;RUN UPDATE
Run ( "Update.exe /quiet" )

ProcessWait("RUNDLL32.exe")

;POTENTIAL ERRORS THAT MAY OCCUR WHILE RUNNING UPDATE
$ERROR1 = "RUNDLL"
$ERROR1TXT = "An exception occured"

; CLASS #32770 Handle 0x00360064, ID:2, ClassNameNN: Button1
WinWait($ERROR1)
ControlClick($ERROR1, $ERROR1TXT, "[CLASS:Button; INSTANCE:1]")
Link to comment
Share on other sites

Hi, maybe you could use some lines in your code to debug where exactly where it hangs.

; Execute Update and Suppress All Errors Messages
;====================================================
;Hides the AutoIT icon
Opt("TrayIconHide",1)

;RUN UPDATE
Run ( "Update.exe /quiet" )
ConsoleWrite('1) Run ( "Update.exe /quiet" )' & @LF)

ProcessWait("RUNDLL32.exe")
ConsoleWrite('2) ProcessWait("RUNDLL32.exe")' & @LF)

;POTENTIAL ERRORS THAT MAY OCCUR WHILE RUNNING UPDATE
$ERROR1 = "RUNDLL"
$ERROR1TXT = "An exception occured"

; CLASS #32770 Handle 0x00360064, ID:2, ClassNameNN: Button1
WinWait($ERROR1)
ConsoleWrite('3) WinWait($ERROR1)' & @LF)

ControlClick($ERROR1, $ERROR1TXT, "[CLASS:Button; INSTANCE:1]")
ConsoleWrite('4) ControlClick($ERROR1, $ERROR1TXT, "[CLASS:Button; INSTANCE:1]")' & @LF)

Once you know exactly where it hangs then you can work out why.

As a guess I'd say it's at the WinWait($ERROR1) part of your script.

Edited by smashly
Link to comment
Share on other sites

The above part of the script is working (TY). I just had to get up to speed on how Au3 works and apply some standard coding practices.

However, now -- I'm trying to controlclick a specific item in a combobox within a tabcontrolview.

The following code works below, however, can I still make it more specific? or eliminate useless code.

Include <GUITab.au3>

$APP = 'TITLE OF PROGRAM'

ShellExecute("example.exe")

WinWaitActive ($APP)

;Attempt to click specific combo item instance 

;Set focus to 1st table in ControlTab View
_GUICtrlTab_SetCurFocus(ControlGetHandle($APP, '', '[CLASS:SysTabControl32;INSTANCE:1]'), 0)

;Control ListView to the ListView Control
ControlListView($APP,"", "SysListView32", "Select", "ClickThisItemInComboBox")

; Click the specific option in the comboControl
ControlClick($APP, "", "[CLASS:Button; INSTANCE:2]")
Edited by pGwtech
Link to comment
Share on other sites

The above code is now working. Au is a decent product.

Okay, so now I'm trying to ShellExecuteWait a specific command, however it has quotes within quotes.

What is the syntax for embededding quotes in a string value?

In vbscript you would have to use a double quote, which I have already tried in Au, with no success -- along with single quotes.

TIA.

pGwtech

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