Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


How to create a job in task scheduler with specific interval (repeat time)?


How to create a job in task scheduler with specific interval (repeat...

Author
Message
M.L.Srinivas
M.L.Srinivas
Forum God
Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)Forum God (3K reputation)

Group: Forum Members
Posts: 17, Visits: 1

Hi,

How to create a job in task scheduler with specific interval (repeat time)?

Upon visiting numerous sites I could manage to create a task for required time.
But to set the interval of repeat?

My script goes like this:
Const MON = 1
Const TUE = 2
Const WED = 4
Const THU = 8
Const FRI = 16
Const SAT = 32
Const SUN = 64


strComputer = "."
strCommand = "c:\TestLog.exe"
strstartTime = "********233000.000000-000"
boolRepeat = True
intWeekDay = MON Or TUE Or WED Or THU Or FRI Or SAT Or SUN
intMonthDay = ""
boolInteract = True

Set objWMI = GetObject("winmgmts:\\" & strComputer & "")
Set objNewTask = objWMI.Get("Win32_ScheduledJob")
intRC = objNewTask.Create(strCommand, _
                          strstartTime, _
                          boolRepeat, _
                          intWeekDay, _
                          intMonthDay, _
                          boolInteract, _
                          intJobID)


Now I want this task to execute every 30 minutes upto 11 PM.

How to do it?

Please help. Any sort of help is appreciated.


Thanks
-Srinivas


GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search