为什么"schtasks"不能完成我的工作?

Mis*_*hko 2 windows-xp scheduled-tasks schtasks.exe

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

"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.
Run Code Online (Sandbox Code Playgroud)

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

schtasks /create /tn "MySQL Automatic Backup" 
         /tr "d:\path with spaces to my script\my script.bat" /sc daily ... 
Run Code Online (Sandbox Code Playgroud)

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

我怎么能解决这个问题?

而另一个问题:
什么在Start In输出列是指schtasks /query /v

谢谢 !

Mis*_*hko 6

我找到了答案:

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.
Run Code Online (Sandbox Code Playgroud)

即它应该是这样的:

schtasks /create /tn "MySQL Automatic Backup" 
         /tr "\"d:\path with spaces to my script\my script.bat\"" /sc daily ... 
Run Code Online (Sandbox Code Playgroud)