Jump to content
Sign in to follow this  
am632

Script closes itself

Recommended Posts

am632

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
qazwsx

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
am632

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.