如何查找计划任务文件夹的位置

发布于 2024-09-03 09:19:03 字数 297 浏览 6 评论 0原文

我在网上看到参考文献指出 Windows 中的“计划任务”存储在 %SystemRoot%\Tasks 中,我认为它通常等同于 C:\Windows\Tasks

但是,我发现虽然该文件夹存在于我的 Windows 7 系统上,但计划任务并不使用它。

我的系统似乎使用C:\Windows\System32\Tasks

我研究了环境变量,那里似乎没有任何与计划任务相关的内容。

如何发现哪个文件夹用于计划任务?

I have seen references online that state that 'Scheduled Tasks' in Windows are stored in %SystemRoot%\Tasks, which I think usually equates to C:\Windows\Tasks.

However, I observe that while that folder exists on my Windows 7 system, Scheduled tasks doesn't use it.

My system appears to use, C:\Windows\System32\Tasks.

I have studied the Environment variables and there doesn't seem to be anything related to Scheduled Tasks there.

How do I discover which folder is used for Scheduled tasks?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

一城柳絮吹成雪 2024-09-10 09:19:03

任务保存在文件系统和注册表中 任务

存储在 3 个位置:1 个文件系统位置和 2 个注册表位置。

文件系统:

C:\Windows\System32\Tasks

注册表:

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

因此,您需要删除这 3 个位置中损坏的任务。

Tasks are saved in filesystem AND registry

Tasks are stored in 3 locations: 1 file system location and 2 registry locations.

File system:

C:\Windows\System32\Tasks

Registry:

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

So, you need to delete a corrupted task in these 3 locations.

や三分注定 2024-09-10 09:19:03

我想扩展@Jan 的答案:

看来,Task Scheduler 1.0 API 使用C:\Windows\Tasks 文件夹来创建和枚举任务(此示例),而任务计划程序2.0 API 使用 C:\Windows\System32\Tasks 创建和枚举任务 (此示例)。

Windows 控制台实用程序 schtasks 和 GUI 实用程序 taskschd.msc 似乎也使用 Task Scheduler 2.0 API

聚苯乙烯
我发现,如果任务放置在 C:\Windows\Tasks 中并且没有设置AccountInformation,那么任务将不会显示在 Windows 控制台和 GUI 调度程序中。如果您设置 AccountInformation(对于系统帐户甚至为“”)并设置标志TASK_FLAG_RUN_ONLY_IF_LOGGED_ON - 任务将被显示在所有标准应用程序中。

在这里找到解决方案

I want to extend @Jan answer:

It's seems, that Task Scheduler 1.0 API uses C:\Windows\Tasks folder for create and enumerate tasks (this example), while Task Scheduler 2.0 API uses C:\Windows\System32\Tasks to create and enumerate tasks (this example).

It's also seems, that windows console utility schtasks and GUI utility taskschd.msc uses Task Scheduler 2.0 API.

P.S.
I found, that if task placed in C:\Windows\Tasks and have not set AccountInformation, then task won't be displayed in windows console and GUI schedulers. If you set AccountInformation (even "" for SYSTEM account) and set flag TASK_FLAG_RUN_ONLY_IF_LOGGED_ON - task will be displayed in all standard applications.

Solution found here

梦里的微风 2024-09-10 09:19:03

对于 Windows 7 及更高版本,计划任务不是由 cmd.exe 运行,而是由 MMC(Microsoft 管理控制台)运行。不过,%SystemRoot%\Tasks 应该适用于任何其他 Windows 版本。

For Windows 7 and up, scheduled tasks are not run by cmd.exe, but rather by MMC (Microsoft Management Console). %SystemRoot%\Tasks should work on any other Windows version though.

兲鉂ぱ嘚淚 2024-09-10 09:19:03

看起来 TaskCache 注册表数据位于 ...

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache

... 在我的 Windows 10 PC 上(即添加 ScheduleTaskCache 和 TaskCache 之前有一个大写的 C)。

Looks like TaskCache registry data is in ...

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache

... on my Windows 10 PC (i.e. add Schedule before TaskCache and TaskCache has an upper case C).

方圜几里 2024-09-10 09:19:03

MMC 存在多个问题,但在我公司的几乎每台 PC 上,询问调度程序 API 都无法打开并且已以某种方式损坏。因此,您无法编辑、删除或以其他方式修改在 API 决定不再运行之前开发的任务。我们发现解决该问题的唯一方法是完全擦除 C:\Users\ 区域下的个人资料,并强制系统在该人重新登录后重新创建登录。这似乎可以解决 API 问题,并且它再次工作,但是该用户通常不再可见这些任务,因为开发的任务是特定于用户而不是 Windows 7 中的计算机。另一个奇怪的事情是,有时,尽管没有任何可以分析的频率,即使 API 已损坏且无法打开,任务仍会运行。这个问题的原因显然尚不清楚,但各个网站上描述了许多“修复”,但用户配置文件删除和重新添加似乎每次都有效至少一段时间。这些任务现在在 WIN 7 中保存为 XML,因此,如果您在 system32/tasks 文件夹中找到它们,您可以删除它们,或将它们复制到新驱动器,然后将它们导入回任务计划程序。不过,我们还是使用了 Splinterware 的系统调度程序软件,因为我们多次遇到相同的损坏问题,即使修复似乎不是永久性的。

There are multiple issues with the MMC however as on almost every PC in my business the ask scheduler API will not open and has somehow been corrupted. So you cannot edit, delete or otherwise modify tasks that were developed before the API decided not to run anymore. The only way we have found to fix that issue is to totally wipe away a persons profile under the C:\Users\ area and force the system to recreate the log in once the person logs back in. This seems to fix the API issue and it works again, however the tasks are often not visible anymore to that user since the tasks developed are specific to the user and not the machine in Windows 7. The other odd thing is that sometimes, although not with any frequency that can be analyzed, the tasks still run even though the API is corrupted and will not open. The cause of this issue is apparently not known but there are many "fixes" described on various websites, but the user profile deletion and adding anew seems to work every time for at least a little while. The tasks are saved as XML now in WIN 7, so if you do find them in the system32/tasks folder you can delete them, or copy them to a new drive and then import them back into task scheduler. We went with the system scheduler software from Splinterware though since we had the same corruption issue multiple times even with the fix that does not seem to be permanent.

〆一缕阳光ご 2024-09-10 09:19:03

在较新版本的 Windows(Windows 10 和 Windows Server 2016)上,您创建的任务位于 C:\Windows\Tasks 中。它们将具有扩展名 .job

例如,如果您创建任务“DoWork”,它将在以下位置创建任务

C:\Windows\Tasks\DoWork.job

On newer versions of Windows (Windows 10 and Windows Server 2016) the tasks you create are located in C:\Windows\Tasks. They will have the extension .job

For example if you create the task "DoWork" it will create the task in

C:\Windows\Tasks\DoWork.job
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文