discipulus Posted January 26, 2016 Share Posted January 26, 2016 I have an automated script that runs that I'd like to be initiated by an AutoIt script, and then I'd like to have the AutoIt script complete some other tasks as well. The script that's being initiated by AutoIt runs about 4-6 hours. Will my AutoIt script die in that time? Thanks, Michie Link to comment Share on other sites More sharing options...
AutoBert Posted January 27, 2016 Share Posted January 27, 2016 Your script would not die but waiting for ending the startet process. After that it will execute the rest of your scriptcode. While waiting it will do nothing else only waiting, your script is frozen in this time. Run instead of RunWait will immediately return the pid and execute the rest of your scriptcode. Link to comment Share on other sites More sharing options...
rudi Posted February 11, 2016 Share Posted February 11, 2016 Hi. You can use $PID=Run("command") instead of RunWait("command"), *IF* you intend to watch progress indicating things like file time stamps, Process List entries, or to force a termination, if the launched task takes too long. The called task ended, when $PID doesn't exist any more as a process. As AutoBert has pointed out already, with the use of "RunWait()" your script will sit there doing nothing, until the launched process terminates. So the natural timeout is the next power outage, in maximum "next big bang" Regards, Rudi. EmilyLove 1 Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
EmilyLove Posted February 11, 2016 Share Posted February 11, 2016 1 hour ago, rudi said: So the natural timeout is the next power outage, in maximum "next big bang" LMAO Link to comment Share on other sites More sharing options...
JohnOne Posted February 12, 2016 Share Posted February 12, 2016 If the runwait operation takes so long, I see no reason not to do your other tasks immediately. Perhaps with something like this. Func _RunWaitEx($program, $workingdir = "", $show_flag = Default, $opt_flag = Default, $timeout = 0) $pid = Run($program. $workingdir, $show_flag, $opt_flag) Do ; Add some timeout code if desired _MyOtherTasks() Until Not ProcessExists($pid) _Finally() EndFunc Func _MyOtherTasks() ;tasks EndFunc Func _Finally() ;complete stuff EndFunc AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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