Jump to content

Recommended Posts

Posted

$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)

Posted

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 PM
Ahhh The ghost of Larry has returned :ph34r:

Does that count as a post for Larry??

We have enough youth. How about a fountain of SMART?

Posted

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

Posted (edited)

$begin = TimerInit()
run("")
do
$dif = TimerDiff($begin)
until $dif>7200000
winclose()

Edited by konan
Posted

Take a look at the sleep function. This takes a lot less CPU time than the tight-loop methods.

Sleep(7200000)

David Nuttall
Nuttall 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...

Posted

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

Posted

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 Nuttall
Nuttall 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...

Posted

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)
Posted

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}>

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...