Solved

Schedule daily task in vb.net

Posted on 2006-06-30
5
6,786 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 50 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 400 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 50 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Put window Form inside tab page 10 33
Pagebreak issue while printing the aspx page 3 25
Help with converting xml file to excel using VB.NET 3 20
VB.NET 2008 - SQL Timeout 9 24
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

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