edy Posted August 24, 2004 Posted August 24, 2004 How can i , with autoit, run a program or a batc file for a determined time ? Thanks Regards
jhocott Posted August 24, 2004 Posted August 24, 2004 (edited) is there some reason you can't use task manager? ( edit: I think he means Task Scheduler ) Edited August 24, 2004 by Larry Jay
konan Posted August 25, 2004 Posted August 25, 2004 $st=StringSplit(inputbox("Run at the start time","Please Input start time!"),":") ;test input you want time like "2004:08:25:08:27:05" ;note,"2004:8:25:8:27:5" can't start ;start time year=2004,month=08,day=25,hour=08,min=27,sec=05 do Until @YEAR=$st[1] and @MON=$st[2] and @MDAY=$st[3] and @hour=$st[4] and @min=$st[5] and @SEC=$st[6] MsgBox(0,"Time is right","now current time= " & @YEAR & ":" & @MON & ":" & @MDAY & ":" & @hour & ":" & @min & ":" & @SEC)
sykes Posted August 25, 2004 Posted August 25, 2004 is there some reason you can't use task manager? ( edit: I think he means Task Scheduler ) <{POST_SNAPBACK}>This post has been edited by Larry: Today, 07:36 PMAhhh The ghost of Larry has returned Does that count as a post for Larry?? We have enough youth. How about a fountain of SMART?
edy Posted August 25, 2004 Author Posted August 25, 2004 My english is very poor, my question is : when a program or batch file run it must run for example 2 hours then finish. Thanks
konan Posted August 25, 2004 Posted August 25, 2004 where r u from? You can count the time from the program run, after 2 hour close the program.
konan Posted August 25, 2004 Posted August 25, 2004 (edited) $begin = TimerInit() run("") do $dif = TimerDiff($begin) until $dif>7200000 winclose() Edited August 25, 2004 by konan
Nutster Posted August 25, 2004 Posted August 25, 2004 Take a look at the sleep function. This takes a lot less CPU time than the tight-loop methods. Sleep(7200000) David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd...
edy Posted August 25, 2004 Author Posted August 25, 2004 My problem is: I must start at the same time various ping continues (dos schell) then I must close them after a sure time. How to distinguish the various id to close them? Thanks
Nutster Posted August 25, 2004 Posted August 25, 2004 What about something like: $proc1=Run("Ping www.hiddensoft.com") $proc2=Run("Ping www.exn.com") While ProcessExists($proc1) and ProcessExists($Proc2) sleep(10000); wait 10 seconds Wend ' Do whatever needed to clean up David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd...
edy Posted August 25, 2004 Author Posted August 25, 2004 What about something like: $proc1=Run("Ping www.hiddensoft.com") $proc2=Run("Ping www.exn.com") While ProcessExists($proc1) and ProcessExists($Proc2) sleep(10000); wait 10 seconds Wend ' Do whatever needed to clean up <{POST_SNAPBACK}>Thanks now Work with the following change: $proc1=Run("Ping 10.199.181.1 -t ") $proc2=Run("Ping 10.199.181.2 -t ") sleep(10000); wait 10 seconds if ProcessExists($proc1) Then ProcessClose ($proc1) If ProcessExists($proc2) Then ProcessClose ($proc2)
tutor2000 Posted August 27, 2004 Posted August 27, 2004 Dave if your going to do a while processexists can't you just ProcessWaitClose ( "process" [, timeout] ) Rick What about something like: $proc1=Run("Ping www.hiddensoft.com") $proc2=Run("Ping www.exn.com") While ProcessExists($proc1) and ProcessExists($Proc2) sleep(10000); wait 10 seconds Wend ' Do whatever needed to clean up <{POST_SNAPBACK}>
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