MHz 80 Posted October 22, 2004 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
jpm 91 Posted October 22, 2004 I don't understand your problem because on @error= 1 the script exit Share this post Link to post Share on other sites
SlimShady 1 Posted October 22, 2004 (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 October 22, 2004 by SlimShady Share this post Link to post Share on other sites
MHz 80 Posted October 22, 2004 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
jpm 91 Posted October 22, 2004 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
MHz 80 Posted October 22, 2004 Thanks jpm for confirm. Will accept SlimShady solution. Share this post Link to post Share on other sites