WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Time - Timer and Date Functions
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Schedule to run every hour

 Keywords:  Schedule run every hour

Question:

I need to execute a couple different applications in order, every hour. Does Winbatch have to ability to schedule itself?

Answer:

Yes, You can use the TimeWait function to help schedule a task every hour. Here is some sample code....
IntControl(12,9,0,0,0)    ;refuse to terminate WB; allow Windows termination quietly
TimeToWait = "0000:00:00:01:00:00"  ; 1 hour
While 1 ; do forever
      
      Message("","Add Your code Here")
		;RunWait(app1,"")
		;RunWait(app2,"")
		;RunWait(app3,"")
		
		;Get Current time
		Now=TimeYmdHms( )

		;Add an hour to the current time
		HourLater = TimeAdd(Now,TimeToWait)

		;Wait an hour
      TimeWait(HourLater)
endwhile

Article ID:   W14980
File Created: 2001:11:08:12:41:18
Last Updated: 2001:11:08:12:41:18