kingpinzs 0 Posted March 30, 2011 how can I wait for a process to exit but still let the script to run so I can exit the script even when a program is running. I am trying to make a script that will run scanner software that will check for viruses and maleware and clean the hdd one at a time but allow me to close the app if it is taking to long and move on to the next one and also let me exit at any time? Any ideas? Share this post Link to post Share on other sites
kingpinzs 0 Posted March 30, 2011 another words I am trying to make the programs run one at a time but allow the script to exit at any time So I cant use runwait cause it pauses the script and cant exit the script Share this post Link to post Share on other sites
kingpinzs 0 Posted March 30, 2011 is there a way to execute exe's one at a time wating for one to finsh before the other one starts without pausing the script Share this post Link to post Share on other sites
saywell 3 Posted March 30, 2011 allow me to close the app if it is taking too longIf you can define 'too long' you could start the program with a run command, and then use ProcessWaitClose to wait until it has finished, and just put the timeout value in as the last argument.William Share this post Link to post Share on other sites
kingpinzs 0 Posted March 30, 2011 what I mean as to long is if it is not responding or locks up Share this post Link to post Share on other sites
kaotkbliss 146 Posted March 30, 2011 I would think a hotkeyset would be the best route to go because too long usually depends on mood. Sometimes too long could be a few minutes, sometimes an entire day. Implementing the hotkey to skip a process depends on how you set up the script, but I would think the function would work something like Func _skip($process) processclose($process) EndFunc Your script would probably have a runwait for each section it needs to run, so when the process exits, the script knows to move on to the next 010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueekWe're gonna need another Timmy! Share this post Link to post Share on other sites
kingpinzs 0 Posted March 30, 2011 I would think a hotkeyset would be the best route to go because too long usually depends on mood. Sometimes too long could be a few minutes, sometimes an entire day.Implementing the hotkey to skip a process depends on how you set up the script, but I would think the function would work something likeFunc _skip($process)processclose($process)EndFuncYour script would probably have a runwait for each section it needs to run, so when the process exits, the script knows to move on to the nextDoesnt runwait pause the script so I cant do anything tell the runwait is over? Share this post Link to post Share on other sites
kaotkbliss 146 Posted March 30, 2011 I think there is something with hotkey (and maybe onevent) that allows it to interrupt. If it can't interrupt the runwait, then you can use some other method to "pause" the script. I usually use a pixelsearch or pixelgetcolor on a spot I know is going to change when the app is finished. I put the search in a loop that does a small sleep(10) until the color is found (or not found) 010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueekWe're gonna need another Timmy! Share this post Link to post Share on other sites