Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 ?

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

Thanks !

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I found the answer:

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.

i.e. it should be like this:

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.