Solved

Schedule daily task in vb.net

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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 …
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 …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now