Jump to content

Recommended Posts

Posted

Hi All,

I am running a basic script that sometimes runs and more often does not run.

Local $sUserName = "********"

Local $sPassword = "*********"

Local $sDomain = "****"

RunAswait ($sUserName, $sDomain, $sPassword, 0, "C:\Documents and Settings\*********\Desktop\New Folder (3)\setup.exe")

WinWaitActive ("Choose Setup Language")

Send ("{ENTER}")

I have ****'ed out he sensitive details but you can see the script. It will lauch the exe but then not hit enter to move to the next window.

Any ideas?

Posted

Does the script end?

In case it does: The WinWaitActive is returning and the Send is failing.

-> To fix this you can try adding a short sleep after the WinWaitActive and the Send, or Use Controlsend.

In case it does not: The WinWaitActive never finds a matching active window.

-> Check the window info with au3info.

-> Consider changing Opt("WinTitleMatchMode") to another mode.

-> Make sure there are no hidden spaces before the window title.

Return here if still stuck.

p.s. Also check if this installer maybe has a silent install option.

Posted

When the script runs it does launch the window but then just sits and fails to progress to the "SEND -ENTER" command or at least it does not register the keystroke on the window. The script does not end it just sits there active.

Once it hits enter it should start running thorugh an install

How do I use silent params?

Thanks for the help

Posted (edited)

When the script runs it does launch the window but then just sits and fails to progress to the "SEND -ENTER" command or at least it does not register the keystroke on the window. The script does not end it just sits there active.

Once it hits enter it should start running thorugh an install

How do I use silent params?

Thanks for the help

Silent parameters are add after executable like setup.exe /S

It depend of your installer !

Install can be silent or with progressbar...

Edited by wakillon

AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0WIN 11 24H2 X64 - Other Examples Scripts

Posted

It is because you have RunAsWait()

This will wait until the .exe is no longer running before continuing with the script. There fore it never reaches the WinWaitActive() because the .exe is still running when the window pops up.

2 solutions: Use a RunAs() instead. This will work if you don't need it to Wait for some other reason.

If you do need it to wait you can do what I have done in the past, which is create a separate small script that just waits for the proper window and sends enter, then Run this .exe right before the RunAsWait(). since it is a separate process it will work.

.

Posted

You can also add

AutoItSetOption("trayicondebug", 1)

at the beginning of your script, then when you run it you can put your cursor on the tray icon and see what line in the code is currently running.

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

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
×
×
  • Create New...