programming4us
programming4us
DESKTOP

Windows 7 : Scheduling Maintenance Tasks

2/21/2011 10:56:39 AM
You can automate any routine task that you perform. To do this, you can use the Task Scheduler service to schedule the task to run automatically. Not only can you schedule tasks to run once or periodically, but you can also schedule them to run when the computer starts, when you log on, or when a specific event occurs.

1. Getting Started with Task Scheduling

You use the Task Scheduler to view and work with scheduled tasks. To access the Task Scheduler, click Start→Control Panel→System and Security→Administrative Tools→Schedule Tasks.

As Figure 1 shows, scheduled tasks are stored in the Task Scheduler Library. Task Scheduler displays tasks created by you or other users when you select the Task Scheduler Library node in the left pane. Unlike earlier versions of Windows, Windows 7 makes extensive use of scheduled tasks. In the Task Scheduler Library, you’ll find system tasks under Microsoft\Windows and Microsoft\Windows Defender. Tasks under Microsoft\Windows handle many of the background housekeeping tasks on your computer. Tasks under Microsoft\Windows Defender are used to automate malware scans.

NOTE

To ensure that you don’t accidentally delete or modify system tasks, most system tasks are locked so that you cannot edit them. Some system tasks are also hidden. In Task Scheduler, you can view hidden tasks by selecting Show Hidden Tasks on the View menu.

Tasks can have many properties associated with them, including:

  • Triggers that specify the circumstances under which a task begins and ends

  • Actions that define the action a task performs when it is started

  • Conditions that qualify the conditions under which a task is started or stopped

  • Settings that affect the behavior of the task

Figure 1. Viewing your computer’s scheduled tasks


Based on these properties, you can use Task Manager to create two types of tasks: basic tasks and advanced tasks. Basic tasks have only triggers and actions, and are meant to help you quickly schedule a common task. Advanced tasks have triggers, actions, conditions, and settings, and are meant to be used by advanced users or administrators.

2. Creating Basic Tasks

You can create a basic task by completing these steps:

  1. Click Start→Control Panel→System and Security→Administrative Tools→Schedule Tasks.

  2. Click the Action menu and then select Create Basic Task. This starts the Create Basic Task Wizard.

  3. On the Create a Basic Task page, type a name and description of the task. Click Next.

  4. On the Task Trigger page, select a run schedule for the task. You can schedule tasks to run periodically (daily, weekly, or monthly), or when a specific event occurs, such as when the computer starts or when the task’s user logs on. Click Next. The next page you see depends on when the task is scheduled to run.

  5. If you’ve selected a daily running task, the Daily page appears, as shown in Figure 2. Configure the task using these fields and then click Next:

    Start

    Use the Start options to set a start date and time.

    Recur every

    Allows you to run the task every day, every other day, or every nth day, beginning with the start date you set. For example, if you want the task to run every other day, you’d set the “Recur every X days” text box to 2 days.

Figure 2. Configuring a daily scheduled task


  1. If you’ve selected a weekly running task, the Weekly page appears, as shown in Figure 3. Configure the task using these fields and then click Next:

    Start

    Use the Start options to set a start date and time.

    Recur every

    Allows you to run the task every week, every other week, or every nth week.

    Days of the week

    Sets the day(s) of the week when the task runs, such as on Tuesday or on Tuesday and Friday.

  2. If you’ve selected a monthly running task, the Monthly page appears, as shown in Figure 4. Configure the task using these fields and then click Next:

    Start

    Use the Start options to set a start date and time.

    Months

    Use this selection list to choose which months the task runs. You can select all months or months individually.

    Days

    Sets the day(s) of the month the task runs. For example, if you select 2 and 8, the task runs on the second and eighth days of the month.

    On

    Sets the task to run on the nth occurrence of a day in a month, such as the second Monday or the third Tuesday of every month.

  3. If you’ve selected “One time” for running the task, the “One time” page is displayed. Use the Start options to set a start date and time. Click Next.

  4. If you’ve selected “When a specific event is logged,” the “When a specific event is logged” page is displayed. You’ll need to select the event log to monitor and the specific event source, event ID, or both. Click Next.

  5. If you’ve selected “When the computer starts,” the task will run when the computer starts.

  6. If you’ve selected “When I log on,” the task will run only when you log on.

  7. On the Action page, specify the task to perform. You can start a program, send an email, or display a message. Click Next. The next page you see depends on the action you selected.

  8. If you’ve selected Start a Program, you’ll see the Start a Program page, shown in Figure 5. Click Browse to display the Open dialog box and then select the program or script to run. You’ll find system utilities, such as Disk Cleanup (cleanmgr.exe), in the %SystemDrive%\Windows\System32 folder. Click Next.

  9. If you’ve selected Send an E-mail, you’ll see the Send an E-mail page. You can then configure the automated email to send by completing the From, To, Subject, and Text fields of the email message. In the “SMTP server” text box, enter the FQDN (Fully Qualified Domain Name) of the mail server through which you will send your message. Click Next.

  10. If you’ve selected Display a Message, you’ll see the Display a Message page. You can then configure the message to display on the desktop when the task is started. Enter the title and text of your message in the text boxes provided. Click Next.

  11. On the Summary page, review the task details and then click Finish. By default, basic tasks you create run under your account and will run only when you are logged on.

Figure 3. Configuring a weekly scheduled task


Figure 4. Configuring a monthly scheduled task


Figure 5. Selecting the program to start


3. Creating Advanced Tasks

You can create an advanced task by completing these steps:

  1. Click Start→Control Panel→System and Security and then click the Schedule Tasks link under Administrative Tools.

  2. Click the Action menu and then select Create Task. This opens the Create Task dialog box.

  3. On the General tab, shown in Figure 6, type a name and description for the task you are creating. By default, the task runs only when you are logged on. If you want to run the task regardless of whether you are logged on, select “Run whether user is logged on or not.” You can also elect to run with highest privileges and configure the task for earlier releases of Windows.

  4. On the Triggers tab, create and manage triggers using the options provided. Using triggers, you can schedule tasks to run periodically (daily, weekly, or monthly), or when a specific event occurs, such as when the computer starts or when the task’s user logs on. To create a trigger, click New, use the options provided to configure the trigger, and then click OK.

  5. On the Actions tab, create and manage actions using the options provided. You can start a program, send an email, or display a message. To create an action, click New, use the options provided to configure the action, and then click OK.

  6. On the Conditions tab, specify any limiting conditions for starting or stopping the task.

  7. On the Settings tab, choose any additional optional settings for the task.

  8. Click OK to create the task.

Figure 6. Configuring the settings for the task


4. Managing and Troubleshooting Tasks

You can access the current tasks configured on your computer through the Task Scheduler. You can view and manage scheduled tasks that you or other people created by completing the following steps:

  1. Click Start→Control Panel→System and Security→Administrative Tools→Schedule Tasks.

  2. In the left pane, select the Task Schedule Library node to display tasks created by you or other people.

  3. Select a task to view its properties using the tabs provided (see Figure 7). Note the task status, last runtime, and last run result. If a task has a status of Queued, it is waiting to run at a scheduled time. If a task has a status of Ready, it is ready to run on its next runtime. If a task should be running automatically but has a Last Run Time of Never, you’ll need to check the task’s properties to determine why it isn’t running. If the Last Run Result is an error, you’ll need to resolve the referenced problem so that the task can run normally.

  4. If you want to manage the task, right-click the task and then:

    • Select Delete to delete the task.

    • Select Disable to disable the task so that it doesn’t run.

    • Select Properties to edit the task’s properties.

    • Select Run to run the task.

    • Select End to stop a running task.

Figure 7. Reviewing the task status


You can view all running tasks by selecting Display All Running Tasks on the Action menu. When checking for problems with tasks, keep in mind that a task that is listed as Running might not in fact be running, but instead might be a hung process. You can check for hung processes using Last Run Time, which tells you when the task was started. If a task has been running for more than 24 hours, there is usually a problem. To stop the task, right-click it in the Task Scheduler and then select End. When prompted to confirm, click Yes.
Other  
  •  Windows Server 2008: DHCP/WINS/Domain Controllers - Exploring Global Catalog Domain Controller Placement
  •  Windows Server 2008: DHCP/WINS/Domain Controllers - Planning, Migrating, and Maintaining WINS
  •  Windows Server 2008 : DHCP/WINS/Domain Controllers - Installing and Configuring WINS
  •  Windows Server 2008 : DHCP/WINS/Domain Controllers - Reviewing the Windows Internet Naming Service (WINS)
  •  Windows Server 2008 : DHCP/WINS/Domain Controllers - Securing DHCP
  •  Windows 7 : General Maintenance Tools (part 3) - Checking Your Disks for Errors & Optimizing Disk Performance
  •  Windows 7 : General Maintenance Tools (part 2) - Cleaning Up Your Disk Drives
  •  Windows 7 : General Maintenance Tools (part 1) - Updating Your Computer
  •  Windows Server 2008 : DHCP/WINS/Domain Controllers - Exploring Advanced DHCP Concepts
  •  Windows Server 2008 : DHCP/WINS/Domain Controllers - Implementing Redundant DHCP Services
  •  
    video
     
    Video tutorials
    - How To Install Windows 8

    - How To Install Windows Server 2012

    - How To Install Windows Server 2012 On VirtualBox

    - How To Disable Windows 8 Metro UI

    - How To Install Windows Store Apps From Windows 8 Classic Desktop

    - How To Disable Windows Update in Windows 8

    - How To Disable Windows 8 Metro UI

    - How To Add Widgets To Windows 8 Lock Screen

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010
    programming4us programming4us
    programming4us
     
     
    programming4us