Solved

Schedule daily task in vb.net

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 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