SchTasks does not run when task has long name

From Birnam Designs Wiki

Jump to: navigation, search

When a task whose path has spaces or other characters that require the path to be in quotation marks is added to schtasks, it will not run because the processor took the initial quotes as delimiters of the parameter, not literally. In order to get this to run correctly an additional \" must be added within the quotes.

incorrect schtasks /create /tn "my task" /tr "c:\foldername containing spaces\script.bat arguments" /sc once /sd 07/29/2003 /st 10:01

correct schtasks /create /tn "my task" /tr "\"c:\foldername name containing spaces\script.bat\" arguments" /sc once /sd 07/29/2003 /st 10:01

Share This!
This page was last modified on 20 January 2009, at 01:25. This page has been accessed 380 times.