在 Windows 中以编程方式创建计划任务 - 0x8004130f 错误 [英] Programmatically Creating a Scheduled Task in Windows - 0x8004130f Error

查看:68
本文介绍了在 Windows 中以编程方式创建计划任务 - 0x8004130f 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行计划任务时遇到了重大问题.使用 Microsoft 提供的 ITaskScheduler 接口可以很好地创建任务.该任务设置为仅在用户登录时运行.

I am having major problems getting a scheduled task to run. The task is created fine using the ITaskScheduler interface provided by Microsoft. The task is set to run only if a user is logged on.

问题是任务没有运行,日志文件 SchedLgU.txt 引用的原因是:

The problem is that the task does NOT run and the log file SchedLgU.txt cites the reason as being:

"The attempt to retrieve account information for the specified task failed; therefore, the task did not run. Either an error occurred, or no account information existed for the task.

The specific error is:

0x8004130f: No account information could be found in the Task Scheduler security database for the task indicated."

我知道可以在没有帐户信息的情况下创建计划任务,因为 Google 更新程序计划任务执行此操作,并且运行良好.

I know for a fact that a scheduled task can be created with no account information because the Google Updater scheduled task does this, and it runs fine.

我可以从网络搜索中收集到的是,Windows 有一个计划任务数据库",它需要有每个任务的凭据信息才能运行.

All I can gather from web searches is that Windows has a "scheduled task database" that needs to have credential information for each task for it to be able to run.

有谁知道如何修改这个凭证数据库或以任何其他方式让我的任务运行?

Does anyone know how to modify this credential database or any other way to get my task to run?

推荐答案

GoogleUpdateTaskMachine 任务使用NT AUTHORITY\SYSTEM"来运行任务.您可以通过使用 schtasks 命令和以System"或"作为参数的/ru 开关来执行此操作.像这样:

The GoogleUpdateTaskMachine Task uses the "NT AUTHORITY\SYSTEM" to Run the task. You can do this by using schtasks command and the /ru switch with "System" or "" as the parameter. Like this:

schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly /d 15 /ru "System"

它不会提示输入密码.

有关详细信息,请参阅 technet.

See technet for more info.

这篇关于在 Windows 中以编程方式创建计划任务 - 0x8004130f 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆