Export Task from Task Scheduler in Windows

    Export Task from Task Scheduler in Windows

    How to Export a Task from Task Scheduler in Windows

    Published by BrinkCategory: Backup & Restore
    28 Sep 2016 Last Updated: 19 Jun 2017 at 13:16

    Published by


    Brink's Avatar
    Administrator

    Posts: 24,290

    Show Printable Version 


    How to Export a Task from Task Scheduler in Windows

    information   Information
    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:





    Export Task from Task Scheduler in Windows OPTION ONE Export Task from Task Scheduler in Windows
    To Export a Task in Task Scheduler

    1. Press the Win+R keys to open the Run dialog, type taskschd.msc, 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)

    Click image for larger version. 

Name:	Export_task-1.png 
Views:	154 
Size:	80.8 KB 
ID:	103556

    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)

    Click image for larger version. 

Name:	Export_task-2.png 
Views:	84 
Size:	27.3 KB 
ID:	103557

    4. When finished, you can close Task Scheduler if you like.






    Export Task from Task Scheduler in Windows OPTION TWO Export Task from Task Scheduler in Windows
    To Export a Task in Command Prompt

    Note   Note
    For more details about the schtasks and schtasks /Query commands, see: Schtasks.exe (Windows)


    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"

    Click image for larger version. 

Name:	Export_task_command.png 
Views:	79 
Size:	15.5 KB 
ID:	103558

    Note   Note
    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:

    Code:
    schtasks /Query /XML /TN "\Create Restore Point on Schedule" > "%UserProfile%\Desktop\taskname.xml"
    Click image for larger version. 

Name:	task_info.png 
Views:	80 
Size:	82.9 KB 
ID:	103559


    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.






    Export Task from Task Scheduler in Windows OPTION THREE Export Task from Task Scheduler in Windows
    To Export a Task in PowerShell

    Note   Note
    For more details about the Export-ScheduledTask command, see: Export-ScheduledTask - Microsoft TechNet


    1. Open PowerShell.

    2. Type the command below into PowerShell, and press Enter. (see screenshot below)

    Export-ScheduledTask -TaskName "task folder location\task name" > "%UserProfile\Desktop\name.xml"

    Click image for larger version. 

Name:	Export_task_PowerShell.png 
Views:	22 
Size:	14.6 KB 
ID:	140233

    Note   Note
    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:

    Code:
    Export-ScheduledTask -TaskName "\Create Restore Point on Schedule" > "$env:UserProfile\Desktop\taskname.xml"
    Click image for larger version. 

Name:	task_info.png 
Views:	80 
Size:	82.9 KB 
ID:	103559


    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


  1.    27 Aug 2017 #1
    Join Date : Jul 2017
    Posts : 32
    windows 10

    export all tasks: Create a folder "task" in the desktop
    Run Powershell as admin:
    Code:
    Get-ScheduledTask | foreach {
    Export-ScheduledTask -TaskName $_.TaskName -TaskPath $_.TaskPath |
    Out-File (Join-Path "C:\Users\Me\Desktop\task" "$($_.TaskName).xml")
    }
    Import/Restore all tasks tasks: https://www.petri.com/import-scheduled-tasks-powershell
    credit to the link above
      My ComputerSystem Spec

 


Similar Threads
Tutorial Category
Task Scheduler run task when logged in Remotely
Hey everyone I tried using this guide (How To Easily Send Emails From The Windows Task Scheduler) to create a task that will send me an email whenever someone connects with RDP.The task works and sends the email if i run it, but i am unsure how to...
General Support
Windows 10 Task Scheduler Event ID 414 Error
I'm getting the following error: Task Scheduler service found a misconfiguration in the NT TASK\Microsoft\Windows\Media Center\RegisterSearch definition. Additional Data: Error Value: %SystemRoot%\ehome\ehPrivJob.exe. <Event...
General Support
How to show Command Prompt Window when running task in Task Scheduler?
Is there a way to make the "Command Prompt" window show when I have a task running in Windows task Scheduler? I would like to be able to view the progress of the task. For example, I have a program called "Zap2xml" that collects TV EPG data. It...
General Support
Windows 10 Task Scheduler not finding Admin
I've got 2 users on one machine. One "Standard" user and one "Administrator". They both log in fine. The Admin user has a password assigned, the Standard user does not. I am trying to run a program that requires elevated access on logon of the...
General Support
Solved Time Zone change causes error in Task Scheduler for every task
My issue is kind of strange. I am an insider currently on Windows 10 build 10240. All the build I have tried so far has this same error in task scheduler when I change my time zone to my current location which is kathmandu (UTC+5:45). When i change...
Performance & Maintenance
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 15:44.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums