Windows 7 任务计划程序不断返回操作代码 2 [英] Windows 7 task scheduler keeps returning operational code 2
问题描述
我设置了一个计划任务以在我的帐户下运行.它运行的所有内容,即使成功,也会返回 (2) 的操作代码.我在下面的链接中查找了此错误代码,它声称找不到特定文件.
I set up a scheduled task to run under my account. Everything it runs, even if it is successful, returns an operational code of (2). I looked this up this error code at the below link, and it claims it cannot find the specific file.
http://www.hiteksoftware.com/knowledge/articles/049.htm
即使我做一些非常简单的事情,我也会得到 (2) 的操作代码.例如:
Even if I do something very simple, I get back operational code of (2). For example:
run program: cmd.exe
start in path: c:\windows\system32
我启动了任务,我在任务管理器中看到了正在运行的进程,所以我终止了任务.然后我检查计划任务的历史记录,它显示为(2).
I start the task and I see the process running in my task manager, so I kill the task. I then check in the history of scheduled task and it shows up as (2).
我正在做的事情更现实:
Something more realistic of what I am doing:
<?
/* file in c:\php\test.php */
echo "hello";
?>
运行程序:php.exe
从路径开始:c:\php
参数:-f test.php
一切都在命令行中工作,但 Windows 计划任务不断返回操作代码 (2).我应该看到 (0) 的操作代码,这意味着成功,对吗?
Everything works in the command line, but Windows schedule task keeps returning operational code (2). I should be seeing an operational code of (0), which means successful, correct?
推荐答案
您可能没有在编辑操作"对话框的开始于(可选)"框中放置路径.
You may not have put a path in the "Start In (Optional) box of the Edit Action dialog box.
即使您在正在执行的程序上有一个路径,Windows 7 仍然希望您告诉它在何处运行该程序.
Even though you had a path on the program that was being executed, Windows 7 still wants you to tell it where to run the program.
这篇关于Windows 7 任务计划程序不断返回操作代码 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!