Create/Configure Task Scheduler in Windows Operating System

1 comment
Hello Everyone,

In following post we will see how to create Task schedulers and configuration of task schedulers.

Task Scheduler:

Task Scheduler is a built-in program in Windows Operating System which allows you to schedule tasks and reminders.

Advantages

1. You can schedule remainder in system which helps you a lot on doing the thing on time.
2. You can schedule system backups
3. You can back up and restore your task even if you format OS.(or) set the same task in another system.

Now,We will see how to Configure scheduler.

Step 1:
Open Control panel from All Programs . (Or) type "control" in run and Enter.


Step 2:
Click on System and Security .



Step 3:
click on Schedule Task under Administrative Tools



Step 4:
Now, Task Scheduler window will open.Click on Create Basic Task on right side section at "Actions"



Step 5:
Specify Task Name and Description in Task Wizard and click on Next.


Step 6:
Now select when do you want to schedule your task.



Step 7:
In our case I am selecting "when I log on" and click on OK.



Step 8:
Now, you need to specify a action.In our demo i am selecting "Display a message" and click on "Next"



Step 9:
Add the Title and Message and click on Next.



Step 10:
Now under finish section , select the check box and click on finish button.
(check box is used to view the properties of the task)



View Active Tasks

Step 11:
In Task Scheduler home page under "Active Tasks" section , you can view all active tasks.



Step 12:
If you click on the Scheduler , you can see the all the Properties.



Step 13:
To run the Task Scheduler(Testing purpose) click on "run".



Step 14:
Now , restart your machine to check the Task Scheduler.


NOTE:Windows 8 Task Scheduler only allows you to create tasks which can launch programs, that's it. Display message and send email features are now deprecated in Windows 8.

In Windows 8 if you try to schedule a task with "Display Message" and "Send Mail" it will throw the error code :2147750704

 Schedule executable in Task Scheduler

Step 1:
Open the Visual Studio . select the "Console Application" and specify name and solution Name.


Step 2:
add the System.Web.Forms reference and add namespace in Program.cs



Step 3:
Now, write the code to show the Message Box.




using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SampleTaskScheduler
{
    class Program
    {
        static void Main(string[] args)
        {
            Program obj = new Program();
            obj.MyMessage();
        }
        public void MyMessage()
        {
            try
            {
                MessageBox.Show("Hi Mahesh.. Have a nice Time...!!!");
            }
            catch (Exception ex)
            {               
                throw;
            }
        }
    }
}

Step 4: 
Build the Application and Test it once.

Step 5: 
From the Step 9 , select the "Start Program" under Action section and click on Next.



Step 6: 
Here we need to specify the path of the executable file.


Step 7: 
copy the path from the debug folder.



Step 8: 
Now , Specify the Path and click on Next and finish. Scheduler will run as per the executable code.



Related Post

1 comment: