Hello,
I have a script which needs to be updated/debugged to start my task at the specific date and time (Currently, this script executes if the scheduling is done for that day, i wanted to delay the task to start by next day it doesn't work,something is wrong, as its not launching at the particular time instead some other time is considered for launching the task).
Below is the Function:
Function TaskScript
Dim scheduledTime, waited
Dim objShell
Set objShell = Wscript.CreateObject("WScript.Shell")
Dim shour, sminute
shour = Inputbox("Enter hour : (in 24h format)." & vbCrLf & "For example: 3 PM should be 15")
sminute = Inputbox("Enter Minute for scheduling")
Do
scheduledTime = Int(Now) + TimeSerial(shour, sminute, 00)
waited = DateDiff("S", Now, scheduledTime)
msgbox "Task Activated"
If waited <= 600 Then
Wscript.Sleep waited * 1000
objShell.run Launch_DB
Wscript.Quit
Else
WScript.Sleep 590 * 1000
End If
Loop
End Function
For Example : If i call the above function and mention shour = 13 and sminute = 00. the script exactly launches at 13h00.
Question :
If i wanted to execute my task next day, What should be the shour and sminute value? (I tried giving it like adding 24 (to say not today) + 13 (the next day) = 37 as shour, it doesn't invoke at next day 13h00, instead its delayed)
Any help would be really appreciated.
Thanks in Advance.
sbk