.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Task scheduler in C#(windows)

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :WPF

hello all,

i am trying to make a task scheduler using C#.net (a desktop application). I have an example to help in doing this job which registers an exe file compliled using C# in visual studio. According to this example, this service after registering runs and looks which job is scheduled and at what time. When found, a particuler job(programe) runs automatically.

I have done accoding to this example but i did not achieve my goal! I have a poor idea of such assignments! I request you to please help me!

Here is the code that I am using:

(A component file)

using System;

using System.ComponentModel;

using System.Collections;

using System.Diagnostics;

using System.ServiceProcess;

using System.Xml;

using System.Timers;

using System.Threading;

using System.Configuration;

View Complete Post

More Related Resource Links

Windows with C++: Task Scheduler 2.0


The new Task Scheduler in Windows Vista can do so much more than previous versions. We introduce some basic concepts and building blocks you can put to use in your own scheduled task projects.

Kenny Kerr

MSDN Magazine October 2007

Schedule a task with windows scheduler and vb script.



I need to schedule a task in my system with windows task scheduler and vbscript(or js also). 

I want to send an http request for an aspx page in my project fom the vbscript file .This aspx page contains some database related operations.

That means when the task scheduler is started it should update my project db.


I got this link for reference


But it is not working for me.

Can anybody pls help me to accomplish this task? Can i use javascript instead of vb script?

My project is in C# and backend is sql server express 2008

Thanks, in advance




FTP Task working in XP but not working in Windows 7/2008 machines

Hey , A FTP Task in IS pkg is working fine when executed through BIDS in my Win XP machine ..but the same package is not working in Win 7/2008 machine. FTP task fails with the error : [FTP Task] Error: Unable to connect to FTP server using "FTPFolder.TempData.com". Here are few facts about my troubleshooting : 1) From my XP machine... I am able to connect to the FTP Server using DOS Cmds but fails in 2008 machine saying "Unknown host" I did : Run>Cmd>FTP>Open FTPFolder.TempData.com 2) I can view the files on the FTP server through a browser ( URL was given )on both the machines with no issues. 3) I created Port exception for 20 & 21 Ports for 2008 machine ...still no luck. 4) When I PING the FTP server --Cmd>PING FTPFolder.TempData.com On XP Machine...though FTP Server Name is resolved to IP... I still receive "Request timed out." On 2008 Machine ...the IP is not even resolved and error is thrown "Ping request could not find host FTPFolder.TempData.com. Please check the name and try again." 5) I am connecting to FTP Server from my Office machines. I have searched all the threads on this FTP error topic and haven't found the apt thread..so I have opened a new one.

Task scheduler and System.IO.File.WriteAllText() not working properly

I have a simple console application that has this in mainline:  Console.WriteLine(System.String.Format("the current directory is: {0}", System.IO.Directory.GetCurrentDirectory())); System.IO. File.WriteAllText(@"test.txt", "new contents");   Console.ReadLine(); I compile this in VS 2010 and copy the EXE to a directory named "c:\test".  When I run this code in two different OS's via "Task Scheduler" and "Scheduled Task" I get different results.   In Windows Server 2003 R2 "Scheduled Task" this code will create a file as I would expect, c:\test\test.txt with the proper contents written to it.  When I run this same code on Windows 2008 R2 (64 bit version) "Task Scheduler" it writes the expected contents to an unexpected location, c:\C:\Windows\SysWOW64\test.txt. In both environments if I run the exe's from a command line, it writes to c:\test\test.txt as I would expect. As I understand it, if you don't fully qualify the file name in the first parameter of the WriteAllText method it will write the contents to the file in the directory of the executable however this seems to break down when running in the Windows 2008 Task Scheduler.  I know I can fully qualify the file name or put the expected path in a

Sharepoint 2010 WorkFlow Task AssignedTo Windows Group doesnt send email notification

Hi, Which configuration would prevent sharepoint to send a notification when a workFlow task is assigned to a Windows Group with an email ? The same task with a single User send a notification. Thanks, Patrice      

WCF client as a windows service or scheduled task



I am consuming a web service in a WCF Client app and subsequently update my DB with the latest updates. The WCF is configured using basicHttpBinding, securityMode of TransportCredentialOnly, and clientCredentialType of Windows.  My timeouts (Close, Open, Receive, Send) are all set to 10 minutes.  I am using a Sql Server Agent Proxy with the correct Domain account (actually the same account that is logged into the server itself) given the SSIS Package Execution subsystem and said Proxy is being used for the 'Run as' in the package Step.  The account is a local Administrator AND a sysadmin.

I want to host this WCF app as a Windows service or a scheduled task. I want to know if I can do this and if so, how to accomplish? This service handles minimum of 100 records to max of 100,000 records. The task needs to be automated and scheduled. Appreciate any inputs.

Thank you


Windows Application Migration - Visual Studio 2008 to 2010 - The "GenerateResource" task failed unex


I hav a windows forms application built using VS 2008 which I am trying to migrate to VS 2010 & .net 4.0.

I got this nasty bug and found that it is due to the embedded images in the resource file.

<!-- [if gte mso 10]> <mce:style>

The "GenerateResource" task failed unexpectedly. System.InvalidOperationException: The security state of an AppDomain was modified by an AppDomainManager configured with the NoSecurityChanges flag.

I tried the following solutions suggested in various forums.

I added the < NetFx40_LegacySecurityPolicy enabled

Cusom Role + task provider that wotk with windows and claims identties


I have created a custom principal that is populated with roles from a custom role store (SQL database). I also use a custom SQL Role provider.

I need to implement tasks that are related to a role. These tasks should have a business rule attached to it. For example user's that belong to the Approver role and the batch approval task should only be allowed to approve for amount greater than 1000 and customer x.

I know Azman provides this functionality or NetSQAzman but I can't use it due to my custom authorization should work with both windows and claims identities.

Any ideas? 

Thank you


Not able to create scheduled task in windows server 2003 using a batch file



I am working on a .net 1.1 windows forms application. We have windows 2003 service pack 2 as the server operating system which uses IIS 6.0.

We have a report generation section. User submits report from the screen(c# code) to run report on a specified time. This request will create a batch file with the AT command with the time specified by the user. This batch file will create an AT job in scheduled tasks window and this AT job will a call another scheduler. This scheduler will generate the report.

the AT command looks like T 16:32 /INTERACTIVE C:\Inetpub\wwwroot\mywebservices\bin\Schedulers.GenerateReport.exe


This is working fine in all servers except one server which uses windows 2003 standard edition. The problem is like it is not able to create the batch file and subsequently fails to create the AT job.

Is there any permission related issue by which it is not able to create the batch file from code.

Please advice me!!!

sharepoint workflow task in windows 7 outlook


Hi There!

I have sharepoint approval workflow on Moss2007. Windows XP users are able to approve the task from their outlook. But in windows 7, outlook would not open the task edit form at all and no error message either.

is there anything need to be turned off/on in windows 7 outlook in order to approve an item fro

Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

Serving Silverlight Apps from Windows Mobile

Even if mobile dev is not my every day work, thanks to the .Net Compact Framework, it's still .Net programming.

Here is the scenario:

You come back home, you have a windows mobile phone wifi capable and you want to quickly get access to your phone pictures from your home network.
You just activate the Wifi, run my app and then browse to the provided link from any computer on the network.

Getting Started with Windows SharePoint Services

Of all of the capabilities of SharePoint, I thought I would start with the most basic installation - as a corporate intranet. It is likely that we will need to discuss some of the elements of SharePoint as we go along, so this also gives us the opportunity to review these elements for future reference.

Before going into too much detail, I would like to point out that you can try the core SharePoint framework (known as Windows SharePoint Services or WSS) for free. On Microsoft's Web site you can download a trial version of Virtual PC 2004 (VPC). Using VPC, you can install the Windows 2003 Evaluation Kit and the WSS add-on. This combination will give you 45 days to evaluate the setup.

Building a Searchable Phone Directory with Windows SharePoint Services

I want to continue to build out the intranet site we've started in our previous articles. A standard item in every intranet is a staff/employee list. Most companies implementing Windows SharePoint Services (WSS) are large enough to have a database that contains all employees. We will use the aggregation features of SharePoint to include data from this database into our intranet.

Getting Started with Windows Communication Foundation

Windows Communication Foundation (WCF) provides a unified framework for rapidly building service-oriented applications that makes it easy to build and consume secure, reliable, and transacted Web services. It unifies the capabilities in ASMX, WSE, Remoting, COM+, and MSMQ; therefore developers need to learn only one programming model.

Application Architecture in Windows Forms 2.0

Applications have special support in Windows Forms. For starters, you can manage and tailor your application's lifetime, and, when the work flow is disrupted by an unhandled exception, you can choose from several methods of response. Then, there are several application models that you can employ, including Single Document Interface (SDI) and Multiple Document Interface (MDI) applications, each of which can support either multiple-instance or single-instance mode, the former the VS05 default and the latter requiring special consideration. All applications, however, can discover and use a wide variety of information about the system and environment they execute in.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend