Sign in to follow this  
Followers 0
MHz

WinWait Error Timeout

6 posts in this topic

Run(@ScriptDir & '\i386\winnt32.exe /cmdcons', '', @SW_HIDE)

WinWaitActive('Windows Setup', '', 10)
If @error = 1 then Exit
Send('!y')

Success: Returns 1.

Failure: Returns 0 if timeout occurred.

Why does error = 1 in the script let the installation proceed but error = 0 quits?

Share this post


Link to post
Share on other sites



I don't understand your problem because on @error= 1 the script exit

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

The value of $WinActivated can be 1 or 0 in the following example.

@error is not set when using the function. And when @error is not set (not mentioned in the help file page) it is equal to 0.

Run(@ScriptDir & '\i386\winnt32.exe /cmdcons', '', @SW_HIDE)

$WinActivated = WinWaitActive('Windows Setup', '', 10)
If NOT $WinActivated then Exit
Send('!y')
Edited by SlimShady

Share this post


Link to post
Share on other sites

I don't understand your problem because  on @error= 1 the script exit

<{POST_SNAPBACK}>

But, when when @error = 1, the script continues? Does not quit.

Seems inverse to what the guide states?

I understand the line to be If @error = 0 then Exit. That would mean that timeout occured and script would exit. As in failure?

Share this post


Link to post
Share on other sites

But, when when @error = 1, the script continues? Does not quit.

Seems inverse to what the guide states?

I understand the line to be If @error = 0 then Exit. That would mean that timeout occured and script would exit. As in failure?

<{POST_SNAPBACK}>

Sorry for my answer I should have say that WinWaitActive never set @error so the correct code is the SlimShady one :)

Share this post


Link to post
Share on other sites

Thanks jpm for confirm. Will accept SlimShady solution. :)

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