3

I am trying to create a task using task scheduler that can open a specific webpage using firefox and for example I am trying to launch google at a specific time. The command that I try to run is

SchTasks /CREATE /SC WEEKLY /TN google1 /TR "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" www.google.com /ST 21:38

But it gives me an error message

ERROR: Invalid argument/option - 'www.google.com'.
Type "SCHTASKS /CREATE /?" for usage.

I tried just the URL and it could not pull up the application with which the URL was supposed to open and hence specified the path for Firefox. Any clues on how this can be resolved?

Thanks

m4573r
  • 5,631
Abin
  • 33

1 Answers1

3

You're getting mixed up with your quotes a lot. From the help text:

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:

So you should change your syntax a bit, to this:

 SchTasks /CREATE /SC WEEKLY /TN google1 /TR "'C:\Program Files (x86)\Mozilla Firefox\firefox.exe' www.google.com" /ST 21:38

Result:

 SUCCESS: The scheduled task "google1" has successfully been created.
m4573r
  • 5,631
  • Thanks for the quick update. The task is created but it still does not launch the application at the scheduled time. When I check the task on the scheduler the details to start the program looks something like this "C:\Program Files (x86)\Mozilla Firefox\firefox.exe "www.google.com" " – Abin Aug 29 '13 at 16:49
  • I realized the syntax of my first answer was incorrect and changed it since. Did you try with the last version? It shows ok in the task scheduler for me. Look at the properties > action> edit. – m4573r Aug 29 '13 at 16:57
  • Perfect!!! I did not see the update... Worked like a charm!! Thanks a lot :) – Abin Aug 29 '13 at 17:02