scheduled tasks - How to properly quote file path with SCHTASKS -
i'm writing small app generates contents of batch file, using schtasks create scheduled tasks. however, cannot file path working correctly. need set of eyes.
schtasks /create /tn "task1" /tr "\"c:\program_files\spybot - search & destroy\spybotsd.exe\" \autocheck \autofix \autoclose" /st 01:00:00 /sc daily /ru myuser /rp mypass
i've looked @ other threads here, , ms documentation, , think have formed correctly. however, fails output:
error: invalid syntax. mandatory option '/sc' missing.
type "schtasks /create /?" usage.
system cannot find path specified.
i use advice here.
you need escape ampersand caret this:
schtasks /create /tn "task1" /tr "\"c:\program_files\spybot - search ^& destroy\spybotsd.exe\" \autocheck \autofix \autoclose" /st 01:00:00 /sc daily /ru myuser /rp mypass
Comments
Post a Comment