Logo
CAR REVIEW
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
PREGNANCY
 
 
Windows Vista

Maintaining Desktop Health : Using Task Scheduler (part 4) - Managing Tasks

4/22/2013 5:45:10 PM

7. Managing Tasks

Task Scheduler simplifies task management and monitoring. This section explains how to view task history, export tasks, and import tasks.

Display Running Tasks

To display all tasks currently running on the system, open Task Scheduler and select Display All Running Tasks from the Action menu. This opens the All Running Tasks window, and you can click Refresh to manually refresh the display. You can also select one or more tasks and click End Task to stop tasks on demand.

Viewing History

The History tab of a task displays all the known events for that task and allows you to quickly see the last time the task ran and its status. Only events that relate to the currently selected task will be shown, eliminating the need to scour the Task Scheduler event log for individual events from specific tasks.

To view the history of a task, do the following:

1.
If Task Scheduler is not open, start Task Scheduler.

2.
Find and click the task folder in the console tree that contains the task you want to view.

3.
In the console window, click the task that you want to view.

4.
Click the History tab to view the task’s history. Click an event, in the list of events on the History tab, to view the description of the event.

Exporting Tasks

You can export tasks to an .xml file and then import them at some later time, on either the same computer or a different computer. This feature allows for easy portability of tasks from computer to computer.

To export a task, follow these steps:

1.
Right-click the task that you want to export and then select Export, or select Export in the Action pane.

2.
Browse to where you want to save the file, enter the name of the file, and then click Save.

3.
The task will be saved in .xml format. The following example shows a simple task.

<?xml version="1.0" encoding="UTF-16"?>                                           
										<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
										  <RegistrationInfo>                                                              
										    <Date>2006-04-11T13:54:51</Date>                                              
										    <Author>USER1-VISTA\user1</Author>                                            
										    <Description>Test Task</Description>                                          
										  </RegistrationInfo>                                                             
										  <Triggers>                                                                      
										    <TimeTrigger id="1a08ebe4-0527-4e7a-af76-84f2ef1dbfa0">                       
										      <StartBoundary>2006-04-11T13:55:23</StartBoundary>                          
										      <Enabled>true</Enabled>                                                     
										    </TimeTrigger>                                                                
										  </Triggers>                                                                     
										  <Principals>                                                                    
										    <Principal id="Author">                                                       
										      <UserId>USER1-VISTA\user1</UserId>                                          
										      <LogonType>InteractiveToken</LogonType>                                     
										      <RunLevel>LeastPrivilege</RunLevel>                                         
										    </Principal>                                                                  
										  </Principals>                                                                   
										  <Settings>                                                                      
										    <IdleSettings>                                                                
										      <Duration>PT10M</Duration>                                                  
										      <WaitTimeout>PT1H</WaitTimeout>                                             
										      <StopOnIdleEnd>true</StopOnIdleEnd>                                         
										      <RestartOnIdle>false</RestartOnIdle>                                        
										    </IdleSettings>                                                               
										    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>                  
										    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>                 
										    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>                         
										    <AllowHardTerminate>true</AllowHardTerminate>                                 
										    <StartWhenAvailable>false</StartWhenAvailable>                                
										    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>                  
										    <AllowStartOnDemand>true</AllowStartOnDemand>                                 
										    <Enabled>true</Enabled>                                                       
										    <Hidden>false</Hidden>                                                        
										    <RunOnlyIfIdle>false</RunOnlyIfIdle>                                          
										    <WakeToRun>false</WakeToRun>                                                  
										    <Priority>7</Priority>                                                        
										  </Settings>                                                                     
										  <Actions Context="Author">                                                      
										    <Exec>                                                                        
										      <Command>C:\Windows\System32\calc.exe</Command>                             
										    </Exec>                                                                       
										  </Actions>                                                                      
										</Task>                                                                           
									

					  

Importing Tasks

Tasks that have been exported can also be easily imported to another computer or the same computer.

To import a task, follow these steps:

1.
Right-click a task folder under the Task Scheduler Library and select then Import Task, or select Import Task in the Action pane.

2.
Browse to where the .xml file is located and click Open. The task will be automatically imported into the library using the settings contained in the .xml file.

Note

To ensure that the task runs properly, it is recommended that you verify the properties of the task after you import it.


Using the SchTasks.exe Command

This section describes the SchTasks.exe command-line syntax and parameters. The Schtasks.exe command-line interface utility allows an administrator to create, delete, query, change, run, and end scheduled tasks on a local or remote system through the command shell.

Command Syntax

The SchTasks.exe command interface uses the following syntax:

schtasks /<parameter> [arguments]
							

Command Parameters
  • /Create Creates a new scheduled task

  • /Delete Deletes the scheduled task(s)

  • /Query Displays all scheduled tasks

  • /Change Changes the properties of scheduled task

  • /Run Runs the scheduled task immediately

  • /End Stops the currently running scheduled task

  • /? Displays this help message

Creating Tasks

The general syntax for Schtasks.exe is as follows:

SCHTASKS /Create [/S system [/U <username> [/P [<password>]]]] [/RU <username> [/RP <password]] /SC schedule [/MO <modifier>] [/D <day>] [/M <months>] [/I <idletime>] /TN <taskname> /TR <taskrun> [/ST <starttime>] [/RI <interval>] [ {/ET <endtime> | /DU <duration>} [/K] [/XML <xmlfile>] [/V1]] [/SD <startdate>] [/ED <enddate>] [/IT] [/Z] [/F]

Example command:

SCHTASKS /Create /S system /U user /P password /RU runasuser /RP runaspassword
								/SC HOURLY /TN rtest1 /TR notepad                                             
							

					  

Deleting Tasks

Syntax:

SCHTASKS /Delete [/S <system> [/U <username> [/P [<password>]]]] /TN <taskname> [/F]

Example command:

SCHTASKS /Delete /TN "Backup and Restore"
							

Running Tasks

Syntax:

SCHTASKS /Run [/S <system> [/U <username> [/P [<password>]]]] /TN <taskname>

Example command:

SCHTASKS /Run /TN "Start Backup"
							

Ending Tasks

Syntax:

SCHTASKS /End [/S <system> [/U <username> [/P [<password>]]]] /TN <taskname>

Example command:

SCHTASKS /End /TN "Start Backup"
							

Querying Tasks

Syntax:

SCHTASKS /Query [/S <system> [/U <username> [/P [<password>]]]] [/FO <format>] [/NH] [/V] [/?]

Example commands:

SCHTASKS /Query /S system /U user /P password
								SCHTASKS /Query /FO LIST /V                  
							

Changing Tasks

Syntax:

SCHTASKS /Change [/S <system> [/U <username> [/P [<password>]]]] /TN <taskname> { [/RU <runasuser>] [/RP <runaspassword>] [/TR <taskrun>] [/ST <starttime>] [/RI <interval>] [ {/ET <endtime> | /DU <duration>} [/K]] [/SD <startdate>] [/ED <enddate>] [/ENABLE | /DISABLE] [/IT] [/Z] }

Example command:

SCHTASKS /Change /RP password /TN "Backup and Restore"
							
Other -----------------
- Maintaining Desktop Health : Understanding Windows Error Reporting (part 4) - Using the Problem Reports And Solutions Control Panel
- Maintaining Desktop Health : Understanding Windows Error Reporting (part 3) - Architecture of Windows Error Reporting, Configuring Windows Error Reporting
- Maintaining Desktop Health : Understanding Windows Error Reporting (part 2) - Conceptual Components
- Maintaining Desktop Health : Understanding Windows Error Reporting (part 1) - Error Reporting Cycle, Report Data Overview
- Maintaining Desktop Health : Using Performance Information And Tools
- Maintaining Desktop Health : Understanding the Windows System Assessment Tool
- Maintaining Desktop Health : Understanding Windows Eventing (part 2) - Event Viewer User Interface
- Maintaining Desktop Health : Understanding Windows Eventing (part 1) - Windows Eventing Capabilities
- Using Voice and Sounds : Associating a Sound with an Event, Using Alternatives to Sound
- Using Voice and Sounds : Letting Your Computer Do the Talking, Creating a Sound File
- Managing Windows Licensing and Activation : Notification Experience and Reduced Functionality Mode
- Managing Windows Licensing and Activation : Managing Volume License Activation (part 3) - Managing licensing and activation, Implementing KMS activation
- Managing Windows Licensing and Activation : Managing Volume License Activation (part 2) - Leveraging MAK activation, Comparing KMS and MAK activation
- Managing Windows Licensing and Activation : Managing Volume License Activation (part 1) - Centralizing activation with KMS
- Managing Windows Licensing and Activation : Licensing Windows
- Maintaining Desktop Health : Monitoring Reliability and Performance (part 6) - Using Reliability Monitor
- Maintaining Desktop Health : Monitoring Reliability and Performance (part 5)
- Maintaining Desktop Health : Monitoring Reliability and Performance (part 4)
- Maintaining Desktop Health : Monitoring Reliability and Performance (part 3)
- Maintaining Desktop Health : Monitoring Reliability and Performance (part 2)
 
 
Most view of day
- Managing Client Protection : User Account Control (part 3) - UAC Virtualization, UAC and Startup Programs, Compatibility Problems with UAC
- Administering an Exchange Server 2013 Environment (part 1) - Exchange Administration Center - Accessing the Exchange Administration Center
- System Center Configuration Manager 2007 : Available Reports and Use Cases (part 3) - Client Status Reporting
- Working in the Background : WORKING WITH THE NETWORK LIST MANAGER
- Client Access to Exchange Server 2007 : Using Cached Exchange Mode for Offline Functionality
- SharePoint 2010 : Building Composite Solutions (part 2) - External Data Search, External Data and User Profiles
- Using the Windows 7 Libraries : CONSIDERING USER-DEFINED COLLECTIONS
- Sharepoint 2013 : New Installation and Configuration - SharePoint Products Configuration Wizard
- Windows Phone 8 : Scheduled Tasks - Updating Tiles Using a Scheduled Task Agent
- Windows Phone 8 : Working with the Windows Phone Software (part 4) - Adding Content from Nonstandard Locations
Top 10
- Windows Phone 8 : Scheduled Tasks - Scheduled Task API Limitations
- Windows Phone 8 : Scheduled Tasks - Updating Tiles Using a Scheduled Task Agent
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 5) - Editing an Existing To-Do Item
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 4) - Creating the To-Do Item Shell Tile, Saving a To-Do Item
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 3) - Debugging Scheduled Tasks
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 2) - TodoService, TodoItemViewModel
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 1) - TodoItem,TodoDataContext
- Windows Phone 8 : Scheduled Tasks - Using Scheduled Tasks
- Windows Phone 8 : Scheduled Tasks - Background Agent Types
- Windows Phone 8 : Windows Phone Toolkit Animated Page Transitions - Reusing the Transition Attached Properties
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro