Task Scheduler is a tool that allows you to create and automate routine tasks on a Windows 11/10 computer. The native tool is mainly used to run any monitoring tools, and for maintenance tasks such as disk defragmentation, disk cleanup, and install Windows updates. In this post, we will show you the ways in which you can import or export Tasks from Task Scheduler in Windows 11/10.
Task Scheduler can also be used to execute tasks such as starting an application, sending an email message, run commands, executing scripts at a particular day and time, or showing a message box.
How to export a list of all Scheduled Tasks in Windows 11
Task Scheduler can be scheduled in response to the following events or triggers:
- At a specific time.
- At a specific time on a daily schedule.
- At a specific time on a weekly schedule.
- At a specific time on a monthly schedule.
- When the system is booted.
- When the computer enters an idle state.
- When a user logs on.
- When the task is registered.
You can create tasks and schedules based on the above response.
Tasks can be saved as well and if you want, you can import or export the task from one computer to another.
Import or Export Tasks from Task Scheduler
You can import or export a list of Scheduled Tasks in Windows 11/10 using any of the three following methods:
- Using Task Scheduler
- Using Command Prompt
- Using PowerShell
Let’s take a look at the steps involved in relation to each of the listed methods.
1] Using Task Scheduler
This method of using Task Scheduler to import or export scheduled Tasks in Windows 10 is the easiest.
Export
To export, do the following:
- Press Windows key + R to invoke the Run dialog.
- In the Run dialog, type taskschd.msc
- Press CTRL+SHIFT+ENTER key combo to open Task Scheduler in admin mode.
- Click to expand the Task Scheduler Library on the left pane.
- On the middle pane, right-click on the Task and choose Export.
- Choose the location to save the file.
- Click on the Save button.
After saving you can find the XML file in that particular saved location. You can copy this XML file to another machine using a USB drive or you can email the file.
Import
To import, do the following:
Before importing make sure you have copied all the required files to run the tasks. For example, if you are going to run any PowerShell scripts make sure you have copied the script along with the XML file.
Exporting Tasks only export the Task Scheduler task configurations. It won’t copy the required files. So copy all the required files and then start importing.
- Open the Task Scheduler in administrative mode.
- Click to expand the Task Scheduler Library on the left pane.
- Right-click on the folder for the task and choose Import Task.
- Now, browse the XML file location and click on Open.
If you already configured any Task Settings do it after the import.
2] Using Command Prompt
To import or export scheduled Tasks in Windows 10 using Command Prompt, you will need to use the Schtasks.exe command. This command enables users to create, delete, query, change, run, and end scheduled tasks on a local or remote computer.
Export
To export, do the following:
- Press Windows key + R. to invoke the Run dialog.
- In the Run dialog box, type cmd and then press CTRL + SHIFT + ENTER to open Command Prompt in admin/elevated mode.
- In the command prompt window, copy and paste the command below and hit Enter.
- Replace the task_location and task_name placeholder with the actual location and name of the Task from the Task Scheduler.
- You can find the location and name of the Task, if you click on the Task in the middle pane.
- Replace %UserProfile% with your full profile path. Eg C:\Users\Chidum.Osobalu.
schtasks /Query /XML /TN “task_location\task_name” > “%UserProfile%\Desktop\Export Tasks\name.xml”
Once the command is executed make sure the file is located in the correct location which you have mentioned in the command.
Import
To import, do the following:
There is no import option in the command prompt. So, instead of importing and setting the location and script, you can create a new task using the same XML file you exported.
Open Command Prompt in admin/elevated mode.
In the CMD window, copy and paste the command below and hit Enter.
schtasks /create /xml “%UserProfile%\XML file Path\TaskName.xml” /tn “\TASKSCHEDULER-FOLDER-PATH\TASK- NAME” /ru “COMPUTER-NAME\USER-NAME” /rp SystemPassword
Replace the following placeholders in the command:
“%UserProfile%\XML file Path\TaskName.xml – Copy the exported XML file path.
TASKSCHEDULER-FOLDER-PATH – Replace it with the Task location path of the Task in Task Scheduler.
TASK- NAME – You can give any name.
COMPUTER-NAME – Your system Hostname. To get hostname from the system, type hostname in CMD prompt and hit Enter.
USER-NAME – Your system username.
SystemPassword – Input your system password, if you have set one.
3] Using PowerShell
To import or export scheduled Tasks in Windows 10 using PowerShell, you will need to use the Export-ScheduledTask cmdlet.
Export
To export, do the following:
Press Windows key + X to access the Power User Menu.
Tap A on the keyboard to launch PowerShell in admin/elevated mode.
In the PowerShell console, copy and paste the command below and hit Enter.
Export-ScheduledTask -TaskName “task location from scheduler\task name” > “$env:UserProfile\Desktop\name.xml”
Replace the following placeholders in the command:
- Task location from the scheduler
- Task name
- Name.xml
Once you execute the command the task will be exported to the specified location.
Import
To import, do the following:
Here, just like in Command Prompt, there is no import command in PowerShell also. So, you’ll need to use the Register command to create the new task with the exported XML file.
Open PowerShell in admin mode.
In the PowerShell window, copy and paste the command below with slight modification as per your requirement.
Register-ScheduledTask -xml (Get-Content ‘C:\PASTE THE PATH OF THE EXPORTED XML FILE WITH NAME.XML ‘ | Out-String) -TaskName “TASK-IMPORT-NAME” -TaskPath “\TASK-PATH-TASKSCHEDULER\” -User COMPUTER-NAME\USER-NAME –Password TYPE YOUR PASSWORD -Force
Make sure all the caps placeholders are replaced accordingly and execute the command. After the execution of the command, the exported task scheduler will be created as a new task in the Task Scheduler.
The above are the 3 ways you can import or export Tasks from Task Scheduler in Windows 11/10.