27

I would like to know where Windows stores information for Scheduled Tasks. I would like to be able to find the reference for the name, schedule, or command to run associated with a given task. This may not be practical or possible, but I would also like a means to edit the scheduled tasks and their attributes outside the Schedule Tasks console. I've assumed that the data would be in the Registry somewhere, since I doubt it would be stored in a normal file, but I'm uncertain where I should be looking.

DJ Chateau
  • 148
  • 1
  • 11
Evan
  • 566
  • 1
  • 6
  • 15

3 Answers3

52

Windows stores scheduled tasks as XML files, AND in the registry.

You can find them in a few places:

Filesystem:

%systemroot%\System32\Tasks
%systemroot%\Tasks

Registry:

HKLM\Software\Microsoft\Windows NT\CurrentVersion\Schedule\Taskcache\Tasks
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Schedule\Taskcache\Tree

Note: You can't edit the XML files directly in \Tasks for security reasons. See here for more information: https://serverfault.com/questions/440496/ok-to-edit-tasks-xml-file-in-c-windows-system32-tasks

To work with importing the XML files without going through the scheduled task UI you can look at these:

Schtasks.exe
Powershell Scheduled Task Cmdlets

Andre
  • 26,751
  • 7
  • 36
  • 80
malexander
  • 4,522
  • 1
  • 31
  • 37
  • **Great answer**! Can I ask whether you know if there is anything stored per-user in **HKCU**, the **user-profile** or similar user-based locations for scheduled tasks? I briefly perused HKCU and the user-profile and couldn't find anything obvious - light effort however - hoping to save some time if you know outright :-). – Stein Åsmul Jan 24 '18 at 16:04
  • Maybe one more folder to add: `%SystemRoot%\SysWOW64\Tasks`. And Powershell link is broken. – Stein Åsmul Jan 24 '18 at 17:22
3

In Windows 7 they are stored in files under "Windows\System32\Tasks". The files are XML, so you could create and edit task files there.

Other versions of Windows I think they are stored in "%SystemRoot%\Tasks"

drew
  • 51
  • 5
  • 2
    Under XP, the tasks are stored in c:\windows\tasks, but the files themselves are with extension 'job' and are protected from editing (so I don't know whether they are binary or ascii). – No'am Newman Dec 08 '13 at 13:56
3

I needed to delete some tasks as in a script as the final part of a system build.

I discovered you can just delete them eg:

@echo ..Audit hardware

"\\vs-files\General\0000 IT\Bginfo.exe" "\\czwgbak\Software\_Build2015\AuditWorkstation.bgi" /timer:0 /Silent /NOLICPROMPT

@echo delete Scan Setup inis

If not exist %systemroot%\System32\Tasks\ASUS\nul goto reg
rd %systemroot%\System32\Tasks\ASUS /S /Q

:reg

etc...

Alexei - check Codidact
  • 22,016
  • 16
  • 145
  • 164
Steve
  • 31
  • 1