Jump to content

Script worked once, but never before or since...no idea why

Recommended Posts


This script randomly worked once, but I have never been able to get it to work again...
I can't see what the possible problem is. The path is most certainly correct.
Any help would be greatly appreciated. Otherwise I have to install 100+ files individually.


#include <File.au3>
#include <Array.au3>
AutoItSetOption ("WinTitleMatchMode", 1)
AutoItSetOption ("WinTextMatchMode", 2)
AutoItSetOption ("TrayIconDebug", 1)
Local $files = _FileListToArray($folder, "*")
For $i = 1 to UBound($files)
Func install($file)
   $pid = Run($file)
   WinWait("Setup - RealTracks", "Welcome to the RealTracks")
   WinWait("Setup - RealTracks", "Please read")
   WinWait("Setup - RealTracks", "When you are ready")
   WinWait("Setup - RealTracks", "Where should")
   WinWait("Setup - RealTracks", "Setup is now ready")
   WinWait("Setup - RealTracks", "Completing")
Link to comment
Share on other sites

Hello, welcome to the forum.

It will probably only work correctly if the program you are starting has focus the whole time the script is running. This is because you are using Send instead of ControlSend. Refer to the Help file about these two functions, the AU3 Window Info Tool, and other Control functions that you may be able to use. As long as you are reading these particular segments, you might as well read the whole thing two or a hundred times, and become more familiar with the AutoIt language.

Also, when you post code, it is best to enclose it in autoit code tags. That is the little blue button with the A in it, or just use [ autoit ] at the top of your code, and [ /autoit ] at the end. I added the spaces and bold to make this text more visible to you. Neither spaces or boldness is needed in use, I just used them to make it more visible to you.

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

How do you know it's 'hanging' on the first WinWait, and not the Send after it? Use the MsgBox or ConsoleWrite functions thru out your code to display 'where it's at'. Like this:

WinWait("Setup - RealTracks", "Welcome to the RealTracks")
MsgBox(0, '', 'first Winwait done..')
MsgBox(0, '', 'first Send done..')

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

It doesn't Run the first file...
I checked with

$msg = ''
For $i = 1 to UBound($files) -1
   $msg &= String($files[$i])
   $msg &= '    '

MsgBox(0, '', $msg)

And all the files are correct...so why does it not start the Run?

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...