Solved

Schedule daily task in vb.net

Posted on 2006-06-30
5
6,803 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

707 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