How to Export a Task from Task Scheduler in Windows
The Task Scheduler enables you to automatically perform routine tasks on a chosen computer. The Task Scheduler does this by monitoring whatever criteria you choose to initiate the tasks (referred to as triggers) and then executing the tasks when the criteria is met.
You can export a task so that the task is stored in an XML file which can be imported by other users and computers. A task's properties, triggers, actions, conditions, and settings are represented in an XML file.
If you created a task in Task Scheduler, then it would be a good idea to back up the task by exporting it as an XML to make it easy to restore (import) in the future as needed.
This tutorial will show you different ways on how to export a task from Task Scheduler as an .xml file backup in Vista, Windows 7, Windows 8, and Windows 10.
Contents
- Option One: To Export a Task in Task Scheduler
- Option Two: To Export a Task in Command Prompt
- Option Three: To Export a Task in PowerShell
1 Press the Win + R keys to open the Run dialog, type taskschd.msc into Run, and click/tap on OK to open Task Scheduler.
2 Navigate to the task folder location (ex: "Task Scheduler Library") in the left pane, select the task (ex: "Create Restore Point on Schedule") you want to export in the middle pane, and click/tap on Export in the far right Actions pane. (see screenshot below)
3 Browse to the location you want to export the task, type in a name you want for the .xml file, and click/tap on Save. (see screenshot below)
4 When finished, you can close Task Scheduler if you like.
For more usage details about the schtasks and schtasks /Query commands, see: Schtasks.exe | Microsoft Docs)
1 Open a command prompt.
2 Type the command below into the command prompt, and press Enter. (see screenshot below)
schtasks /Query /XML /TN "task folder location\task name" > "%UserProfile%\Desktop\name.xml"
Substitute task folder location in the command above with the actual task's folder location (ex: "") like in Task Scheduler below.
Substitute task name in the command above with the actual task's name (ex: "Create Restore Point on Schedule") like in Task Scheduler below.
Substitute name in the command above with the name you want for the exported .xml file.
For example:schtasks /Query /XML /TN "\Create Restore Point on Schedule" > "%UserProfile%\Desktop\taskname.xml"
3 You can now move the .xml file on your desktop to where you like as a backup of this task.
4 When finished, you can close the command prompt if you like.
For more details about the Export-ScheduledTask command, see: Export-ScheduledTask | Microsoft Docs
1 Open PowerShell.
2 Type the command below into PowerShell, and press Enter. (see screenshot below)
Export-ScheduledTask -TaskName "task folder location\task name" > "$env:UserProfile\Desktop\name.xml"
Substitute task folder location in the command above with the actual task's folder location (ex: "") like in Task Scheduler below.
Substitute task name in the command above with the actual task's name (ex: "Create Restore Point on Schedule") like in Task Scheduler below.
Substitute name in the command above with the name you want for the exported .xml file.
For example:Export-ScheduledTask -TaskName "\Create Restore Point on Schedule" > "$env:UserProfile\Desktop\taskname.xml"
3 You can now move the .xml file on your desktop to where you like as a backup of this task.
4 When finished, you can close PowerShell if you like.
That's it,
Shawn
Related Tutorials
- How to Enable or Disable Scheduled Task in Windows 10
- How to Import a Task to Task Scheduler in Windows
- How to Create Task to Run App or Script at Logon in Windows 10
- How to Delete Scheduled Task in Windows 10