hohenheim Posted March 18, 2011 Share Posted March 18, 2011 If you need your script to be up and running 24 hrs you could write a second script to check every x seconds if the main script is still running. If not restart it or send an email or do whatever you want ...the problem is that the script is still runing when the error occurs, showing the message box of the error. i didn't find a way to disable this default message. Link to comment Share on other sites More sharing options...
hannes08 Posted March 18, 2011 Share Posted March 18, 2011 (edited) Hi hohenheim, I'd suggest to do as iamtheky suggests, and just "Exit" if the situation appears: #include <array.au3> Dim $aArray[5] $aArray[0] = 1 $aArray[1] = 2 $aArray[2] = 3 $aArray[3] = 4 $aArray[4] = 5 for $i = 0 to 5 If $i > ubound ($aArray) - 1 Then msgbox (0, '' , "number of array elements exceeded") exitloop EndIf msgbox (0, '' , $aArray[$i]) Next But also I'd write a second script like this: While 1 $id = Run("yourfirstscript") ProcessWaitClose($id) ;Put in an optional Sleep: ;Sleep(1000) WEnd This will restart your first script / exe everytime it is closed. Edited March 18, 2011 by Hannes123 Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
hohenheim Posted March 19, 2011 Share Posted March 19, 2011 Hi hohenheim, I'd suggest to do as iamtheky suggests, and just "Exit" if the situation appears: But also I'd write a second script like this: While 1 $id = Run("yourfirstscript") ProcessWaitClose($id) ;Put in an optional Sleep: ;Sleep(1000) WEnd This will restart your first script / exe everytime it is closed. I already have a "parent" script that launches this annoying one, with the function RunWait, And treat the exit code when the program ends, Adding a third script is too much I think. Link to comment Share on other sites More sharing options...
Tvern Posted March 19, 2011 Share Posted March 19, 2011 I already have a "parent" script that launches this annoying one, with the function RunWait, And treat the exit code when the program ends, Adding a third script is too much I think.In that case just use the /ErrorStdOut suggestion from AdmiralAlkex to avoid the msgbox with the first script. Link to comment Share on other sites More sharing options...
hohenheim Posted March 20, 2011 Share Posted March 20, 2011 If I'm not wrong, the calling line would be: Runwait("Instance.exe "&"/ErrorStdOut"&$params) ? Link to comment Share on other sites More sharing options...
Tvern Posted March 20, 2011 Share Posted March 20, 2011 Runwait("Instance.exe /ErrorStdOut" & $params) ;or Runwait("Instance.exe /ErrorStdOut " & $params) Depending on wheter or not $params has a leading space. Link to comment Share on other sites More sharing options...
hohenheim Posted March 20, 2011 Share Posted March 20, 2011 I put the changes now I'm waiting for the error . It'll be alright now, thanks you so much guys. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now