2

ユーティリティを使用してWindows-XPでタスクをスケジュールしましたschtasksが、タスクが実行されません。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.

このエラーの理由は、スクリプトへのパスのスペースにあることがわかりました。タスクの設定に使用したコマンドは次のようになります。

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

たとえば、スペースをアンダースコアに置き換えると、問題は解消されます。

どうすればこの問題を解決できますか?

そして別の質問:の出力で列は
何を意味しますか?Start Inschtasks /query /v

ありがとう !

4

1 に答える 1

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.

つまり、次のようになります。

schtasks /create /tn "MySQL Automatic Backup" 
         /tr "\"d:\path with spaces to my script\my script.bat\"" /sc daily ... 
于 2010-10-02T13:39:34.887 に答える