?
Solved

Schedule daily task in vb.net

Posted on 2006-06-30
5
Medium Priority
?
6,825 Views
Last Modified: 2012-08-24
Hi experts,

i need to schedule a daily job at 3.00 am (the time can be changed by the form)

how can i do that in vb.net

i mean, how can i make my program start at this time and every day FOR SURE?

many solutions are possible like timer? or maybe there is a better way to do that?

regards.
0
Comment
Question by:Dnx_7
5 Comments
 
LVL 6

Assisted Solution

by:Nandakumar Sakthivel
Nandakumar Sakthivel earned 200 total points
ID: 17017009
Hi,
   You can use ScheduleTask feature which exists in windows operating system
   Go to
       start\settings\control panel\schedule tasks\AddscheduleTask
   
  In that select the program that you want  to run and also you can set the time intereval.

Thanks,
Nanda
0
 
LVL 2

Author Comment

by:Dnx_7
ID: 17017117
i'm sorry but it's not exactly what i want to do

maybe my explication is bad :(

in fact the program is launched manually but there is a process to be launch at the same time every day

regards
0
 
LVL 28

Accepted Solution

by:
iboutchkine earned 1600 total points
ID: 17017257
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
End Sub

 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

            If DateTime.Now < TimeStart.AddMinutes(5) AndAlso DateTime.Now > TimeStart  Then

'start your program


        End If
Timer1.Enable = false
 End Sub
0
 
LVL 41

Assisted Solution

by:graye
graye earned 200 total points
ID: 17017544
So, your application is just a "front-end" setup program whose job it is to schedule *some other* task to be performed at a later date?

If so, then I'd suggest that you use the built-in Task Scheduler interface in Windows.   Your application would add/delete/modify tasks in the existing Task Scheduler.

OK, I'll admit that writing a program to talks directly to the Task Scheduler is a bit tough (lots of API calls, etc).  However since modern versions of Windows have a command-line interface to the Task Scheduler, it'd be pretty easy to create a command line and "shell out" to accomplish what you need (without a bunch of API calls).

Let us know if this is the direction you want to go...
0
 
LVL 2

Author Comment

by:Dnx_7
ID: 17029385
thanks to you all guys

very good idea graye but it's a lot complicated for what i'm trying to do :)

0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month13 days, 20 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question