我在运行计划任务时遇到了重大问题。使用 Microsoft 提供的 ITaskScheduler 接口可以很好地创建任务。该任务设置为仅在用户登录时运行。
问题是任务没有运行,日志文件 SchedLgU.txt 引用的原因是:
"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 Updater 计划任务可以执行此操作,并且运行良好。
我从网络搜索中得到的信息是,Windows 有一个“计划任务数据库”,每个任务都需要有凭据信息才能运行。
有谁知道如何修改此凭据数据库或任何其他方式来运行我的任务?
GoogleUpdateTaskMachine 任务使用“NT AUTHORITY\SYSTEM”来运行任务。您可以通过使用 schtasks 命令和 /ru 开关以及“System”或“”作为参数来完成此操作。像这样:
schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly /d 15 /ru "System"
它不会提示输入密码。
See technet http://technet.microsoft.com/en-us/library/cc725744.aspx#BKMK_sys_perms了解更多信息。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)