CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    144

    Schedule a task at system startup

    Hello, how can i schedule a task to be executed at system startup of some date ?

  2. #2
    Join Date
    Jul 2005
    Location
    Louisville, KY
    Posts
    201

    Resolved Re: Schedule a task at system startup

    Hello Invader7:

    According to ITGURU, on this thread (http://www.codeguru.com/forum/showthread.php?t=381907), you should be able to create a windows service using C#, then with the following bit of code:


    In the following code, an email would be sent at 9:00AM, but you get the idea.
    Code:
    while (1==1)
    {
         DateTime dtNowTime = DateTime.Now;
         if (dtNowTime.Hour == 9 && dtNowTime.Minute == 0)
         {
              // Write your EMail Sending Code here
         }
    }
    Hopefully, this helps, if it does please rate up.

    Thanks,
    Quinn

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Schedule a task at system startup

    Windows Task Scheduler - AT /?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured