Where does Windows store the settings for Schedule

2020-02-23 06:01发布

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.

3条回答
放荡不羁爱自由
2楼-- · 2020-02-23 06:37

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"

查看更多
劳资没心,怎么记你
3楼-- · 2020-02-23 06:42

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

查看更多
Explosion°爆炸
4楼-- · 2020-02-23 06:44

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...

查看更多
登录 后发表回答