Link to home
Start Free TrialLog in
Avatar of cykerk
cykerk

asked on

Using VB Timer to set an script to run at Particular Time

Hi guys,

Could someone guide me how to use Timer to set a particular script to run at particular time...

let's i wan ABC script (database back up script) to run at every friday  on 10 pm....

pls guide me how to set the timer...thank you
ASKER CERTIFIED SOLUTION
Avatar of Drizzt95
Drizzt95

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of WarLord
WarLord

create 2 textboxes text1 and text2, then create a timer
called timer1

set the interval of the timer to 100

and place this code in your form

Private Sub Timer1_Timer()
Text1.Text = Format(Time, "hh:mm:ss AMPM")
If Text1.Text = "10:00:00 PM" Then
Select Case Weekday(Date)
Case vbSaturday
shell "start placethenameofyourscripthere"
End Select
End If
End Sub

this should work

Greetings Erik


ehm

change Case vbSaturday to Case vbfriday sorry my mistake
cykerk:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
Avatar of DanRollins
Moderator, my recommended disposition is:

    Accept Drizzt95's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer