Jump to content

Run a program for a determined time


edy
 Share

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

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

Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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