How do I rename a task in Task Scheduled on Windows Server 2008 R2

Solution 1:

Congratulations! You've come up against a problem that has stumped many a Windows user/admin. No, you cannot rename a task except for exporting, renaming and importing again. Yes, it's rather silly. Perhaps an enterprising scripter could create a simple PowerShell script that automates this, but until then, you're stuck with your export/import two-step. Sorry. =(

(You also can't rename a task folder after you've created it.)

Solution 2:

Not the best way but can be a life saver.

Tasks are stored in C:\Windows\System32\Tasks in XML format importable using schtasks.exe. As Weasly told, renaming the file doesn't work but Create/Delete will. That said, you need the running user password (that you have)

Compared to Weasly's suggestion, it just skips the export phase.

  1. create a second task using the first as template
  2. remove the original

Using srcname and dstname and an admin shell in Tasks folder:

C:\Windows\System32\Tasks>schtasks /Create /tn dstname /xml srcname /ru [running username] /rp [password]
SUCCESS: The scheduled task "dstname" has successfully been created.

C:\Windows\System32\Tasks>schtasks /delete /tn srcname /f
SUCCESS: The scheduled task "srcname" was successfully deleted.

Notes:

  • With a little bit of scripting, you can rename a large bunch of tasks without effort
  • If needed you should be able to extract the original RU from the XML (in node Task/Principals/Principal/UserId)
  • If you want schtasks to ask for the password, simply remove /rp [password] portion

Solution 3:

Unfortunately not. That's the way this is done now. I believe it's for security purposes, so that set tasks cannot be modified while they are actually setup and enabled.


Solution 4:

Please be sure before you answer "Cannot do this", "Impossible", etc.

Check out this power shell script.


Solution 5:

One possibility is, to export the task, delete the task, rename the file and import it again.

A good description can be found here: Rename task in task scheduler