任务计划程序找不到文件 [英] Task Scheduler cannot find file

查看:651
本文介绍了任务计划程序找不到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows Server 2008 R2 Standard上有大约20个计划的任务.他们已经工作了好几个星期,然后突然在这个周末他们都停了下来.这些任务都是.bat文件和.exe文件,通过单击资源管理器或从cmd运行,每个文件都能正常工作.我创建了一个新任务,从c:驱动器运行一个.bat文件,另一个任务只是显示一条消息,并且对于所有任务始终获得上次运行结果系统找不到指定的文件.(0x8007002)".

以下是建议的不同修补程序的摘要:

-确保运行任务的用户有权使用所有文件 -.bat文件中的所有网络驱动器都应使用完整域而不是本地驱动器号来引用

-在属性的常规"标签中取消选中以最高特权运行"

-从操作中的程序名称中删除文件路径,然后在开始于"中输入路径

-从开始于"中删除引号

-在条件"选项卡中单击仅在计算机使用交流电源时才启动任务",因为某些服务可能会诱使服务器认为它有电池

-在条件"标签上,单击如果计算机不再处于空闲状态,请停止"

-确保用户位于本地安全策略">本地策略">用户权限分配">以批处理作业身份登录"

尝试了所有这些之后,我仍然得到运行结果的找不到指定的文件"和错误值2147942402的任务类别的任务启动失败

还有其他建议吗?如果没有其他希望的话,这是可以尝试解决其他问题的很好的总结.

解决方案

尝试使用:

pushd \\machine\share

位于计划任务的批处理文件中.网络共享驱动器仅在用户运行的环境中可用. "pushd"将允许它在脚本的上下文中运行.

使用完毕后:

popd \\machine\share

取消映射驱动器.

参考: http://www.adrianbanks.co.uk/?p=41

I have about 20 scheduled tasks on Windows Server 2008 R2 Standard. They have been working well for a couple weeks, then all of a sudden this weekend they all stopped. The tasks are all .bat files and .exe files, each working fine by clicking in explorer or running from cmd. I created a new task to run a .bat from the c: drive, and another to simply display a message, and always get the Last Run Result "The system cannot find the file specified. (0x8007002)" for all tasks.

Here is a summary of the different fixes suggested:

-Make sure user that runs the task has permission to use all files -All networked drives in .bat files should be referenced with full domain, not local drive letter

-Uncheck "Run with highest privileges" in the General tab of properties

-remove file path from program name in the action, and enter path into Start In

-remove quotes from Start in

-Unclick "start the task only if the computer is on AC power" in the conditions tab because some services can trick the server into thinking it has a battery

-Unclick "Stop if the computer ceases to be idle" on the conditions tab

-Make sure user is in Local Security Policy > Local Policies > User Rights Assignment > Log on as a batch job

After trying all these, i still get "cannot find the file not specified" for run result and Task Start Failed for Task Category with Error Value 2147942402

Anybody have another suggestion?? If nothing else hopefully this is a good summary of things to try for other issues.

解决方案

Try using:

pushd \\machine\share

within a batch file of your scheduled task. Network shared drives are only available from a user-run environment. "pushd" will allow it to be run in the context of the script.

When you're done use:

popd \\machine\share

to unmap the drive.

Reference: http://www.adrianbanks.co.uk/?p=41

这篇关于任务计划程序找不到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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