Sign in to follow this  
Followers 0
am632

Script closes itself

3 posts in this topic

#1 ·  Posted (edited)

Hi all,

Im trying to makea script which opens the add hardware wizard and clicks next bla on the options i want. But the script keeps closin itself after like the 3rd window.

Here is my script

Run("control.exe hdwwiz.cpl")

WinWaitActive("Add Hardware Wizard", "&Next >")
Send("{ENTER}")

;Searches for hardware at this point

WinWaitActive("Add Hardware Wizard")
Send("{SPACE}")
Send("{ENTER}")

Ok, whilst it is searching for hardware, the script closes (you can see the autoit icon disappear near the clock)

and it wont continue at the next screen - the one where it asks if your hardware is already connected or not.

Please can anyone help me out cos its a right pain in the a*s*

thanks

Edited by am632

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Does the title of the window change after you click next? It may be sending the keys while the window is searching for hardware. Perhaps put in a sleep? Also use consolewrite to see how far the program is running.

Edit: And use a codebox

Edited by qazwsx

Share this post


Link to post
Share on other sites

Hi, tnx for the reply.

I checked the window title but that was the same. Just tried the sleep and worked like a charm. Is there a way to make the script stay open untill it reaches the end tho?

Thanks

And sorry bout the code box, i neva realised there was one

Share this post


Link to post
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
Sign in to follow this  
Followers 0