为什么“schtasks"不运行我的工作? [英] Why "schtasks" does not run my job?

查看:68
本文介绍了为什么“schtasks"不运行我的工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 schtasks 实用程序在 Windows-XP 上安排了一个任务,但该任务没有运行.这是我在 SchedLgU.Txt 日志文件中看到的内容:

I scheduled a task on Windows-XP using schtasks utility, but the task does not run. Here is what I see in the SchedLgU.Txt log file:

"MySQL Automatic Backup.job" (WampServer) 10/2/2010 6:36:43 PM ** ERROR **
Unable to start task.
The specific error is:
0x800700c1: (Unable to find an error message)
Try using the Task page Browse button to locate the application.

我发现这个错误的原因是我的脚本路径中有空格.我用来设置任务的命令如下所示:

I found out that the reason for this error is spaces in the path to my script. The command that I used to set up the task look like:

schtasks /create /tn "MySQL Automatic Backup" 
         /tr "d:\path with spaces to my script\my script.bat" /sc daily ... 

例如,如果我用下划线替换空格,问题就会消失.

If I replace the spaces with underscores, for example, the problem disappears.

我该如何解决这个问题?

How could I solve this problem ?

另一个问题:
Start In 列在 schtasks/query/v 的输出中意味着什么?

And another question:
What does the Start In column means in the output for schtasks /query /v ?

谢谢!

推荐答案

我找到了答案:

Spaces in file paths can be used by using two sets of quotes, 
one set for CMD.EXE and one for SchTasks.exe. 
The outer quotes for CMD need to be double quotes; 
the inner quotes can be single quotes or escaped double quotes.

即应该是这样的:

schtasks /create /tn "MySQL Automatic Backup" 
         /tr "\"d:\path with spaces to my script\my script.bat\"" /sc daily ... 

这篇关于为什么“schtasks"不运行我的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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