Sign in to follow this  
Followers 0
Seth27

run a programm at a certain time

9 posts in this topic

Hi I want that my program "program.exe" runs at 11:50 p.m.

I don't want to use the task planer of windows and others.

Can I program this with autoit.

How can i do this?

Thanks

Share this post


Link to post
Share on other sites



A basic example

$hour = @HOUR
$minute = @MIN
$time = $hour & ":" & $minute

While 1
    Sleep(10)
    if $time = "23:50" Then
        MsgBox(0, "Time" , "The required time is now")
    EndIf
WEnd


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

It tried this, but it doesn't run.

If I run this script at the time it is named in the script, then it runs.

But I want to run the script at morning and then after some hours this script should run my program.

Share this post


Link to post
Share on other sites

It tried this, but it doesn't run.

If I run this script at the time it is named in the script, then it runs.

But I want to run the script at morning and then after some hours this script should run my program.

Look at the TimerInt/TimerDiff Functions in the helpfile if you just want it to run like 8 hours after you start the script

Share this post


Link to post
Share on other sites

mmhh, I only want to start this program at 23:50 daily

Share this post


Link to post
Share on other sites

Simple error:

While 1
    Sleep(10000)
    if @HOUR & ":" & @MIN = "23:50" Then
        MsgBox(0, "Time" , "The required time is now")
    EndIf
WEnd

#)

Share this post


Link to post
Share on other sites

I messed up my first example. The variables should be inside the loop.

While 1
    Sleep(10)
    $hour = @HOUR
    $minute = @MIN
    $time = $hour & ":" & $minute
    if $time = "14:30" Then
        MsgBox(0, "Time" , "The required time is now")
    EndIf
WEnd


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

That runs... THank you very much!

Share this post


Link to post
Share on other sites

I messed up my first example. The variables should be inside the loop.

While 1
    Sleep(10)
    $hour = @HOUR
    $minute = @MIN
    $time = $hour & ":" & $minute
    if $time = "14:30" Then
        MsgBox(0, "Time" , "The required time is now")
    EndIf
WEnd
why do you need the variables at all? Would'nt this work also?

While 1
    Sleep(200); less CPU intesive
    if (@HOUR = "16" and @MIN = "22") Then
        MsgBox(0, "Time" , "The required time is now")
    EndIf
WEnd

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
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
Sign in to follow this  
Followers 0