Sign in to follow this  
Followers 0
C1628

How to run a program in arbitrary time within a certain period everyday?

5 posts in this topic

Dear All,

Can any expert teach me how to write a script to run a Program.exe in any arbitrary time within a certain period everyday?

For example, I want to run a program (C:\Program.exe) in any time between 13:00-14:00 everyday. Today at 13:01, tomorrow at 13:33, day after tomorrow at 13:25, .

Please help!! Thanks in advance.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This is simple.

While 1
If _Time = "13:" & Random(00, 60, 1) & ":" & Random(00, 60, 1) And $Run <> -1 Then
     Run("Program.exe")
     $Run = -1
ElseIf @HOUR <> 13 Then
     $Run = 0
EndIf
Sleep(10)
WEnd
Func _Time()
     $Time = @HOUR & ":" & @MIN & ":" & @SEC
     Return $Time
Endfunc

If it is 1pm (or 13) at a Random Minute and Second then it will run B) Easy

Edited by AutoIt Smith

Share this post


Link to post
Share on other sites

This should be moved to the help forum, but I guess it can now be closed since the question is answered...

Share this post


Link to post
Share on other sites

Yes.... indeed

Share this post


Link to post
Share on other sites

AutoIt Smith, you are of great help!

Thank you so much.

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