In this article, we will see how to backup and restore the tasks you have created in Task Scheduler. This will allow you to restore them quickly after reinstalling the operating system. You can also copy them to another PC by doing a backup first. There are several ways to do this, which we will review.
Task Scheduler is a special tool which comes bundled with all modern versions of Microsoft Windows. It allows the user to schedule the launch of apps, batch files, PowerShell scripts etc after specified time intervals or when certain system events occur. The Task Scheduler has a graphical MMC version (taskschd.msc) which we will use.
If you are not familiar with creation of tasks in Task Scheduler, we have a good tutorial here. Refer to the following article to learn about this topic in detail.
Create elevated shortcut to skip UAC prompt in Windows 10
How to backup a scheduled task in Windows 10
To backup a scheduled task in Windows 10, do the following.
- Open Administrative Tools.
- Click the Task Scheduler icon.
- In the Task Scheduler library, find a task you would like to backup. I will backup the task "Aero Glass".
- Right click the task and select "Export" in the context menu. You will be prompted to export the task as an XML file.
- Specify where to store the file and you are done.
Alternatively, you can export the task via the command prompt or PowerShell.
Backup a scheduled task in Windows 10 using Command Prompt
- Open an elevated command prompt.
- Execute the following command:
schtasks /query /tn "Aero Glass" /xml > "c:\winaero\aero glass.xml"
This will export the task named "Aero Glass" to the c:\winaero\aero glass.xml file.
Correct the task name and the file path as you need.
Note: If you have placed your task in some folder in Task Scheduler, don't forget to include the path to the task as follows:
schtasks /query /tn "My Folder\Aero Glass" /xml > "c:\winaero\aero glass.xml"
Backup a scheduled task in Windows 10 using PowerShell
- Open a new elevated PowerShell instance.
- Execute the following command:
Export-ScheduledTask -TaskName "Aero Glass" > "C:\winaero\aero glass.xml"
This will export the task named "Aero Glass" to the c:\winaero\aero glass.xml file.
Correct the task name and the file path as needed.
Note: If you have placed your task in some folder in Task Scheduler, don't forget to include the path to the task as follows:
Export-ScheduledTask -TaskName "Aero Glass" -TaskPath "\My Folder\" > "C:\winaero\aero glass.xml"
How to restore a scheduled task in Windows 10
To restore a scheduled task from backup in Windows 10, do the following.
- Open Administrative Tools.
- Click the Task Scheduler icon.
- In the Task Scheduler library, click the action "Import Task..." on the right.
- Browse for your XML file and you are done.
Restore a scheduled task in Windows 10 using Command Prompt
- Open an elevated command prompt.
- Execute the following command:
schtasks /create /tn "Aero Glass" /xml "c:\winaero\aero glass.xml"
This will restore the task named "Aero Glass" from the c:\winaero\aero glass.xml file.
Correct the task name and the file path as you need.
Restore a scheduled task in Windows 10 using PowerShell
- Open a new elevated PowerShell instance.
- Execute the following command:
Register-ScheduledTask -Xml (Get-Content "c:\winaero\aero glass.xml" | out-string) -TaskName "Aero Glass"
This will export the task named "Aero Glass" from the c:\winaero\aero glass.xml file.
Correct the task name and the file path as you need.
Note: If you are going to restore the task on a different computer with different login credentials, you might need to edit the XML file and change the user name (and password) to match the target OS.
That's it.
Support us
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
It’s working on Windows 2008 and 7 too.
not working. userid problem