Unable to start firefox to launch a specific page with task scheduler

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

Abin

Posted 2013-08-29T16:18:47.743

Reputation: 33

Answers

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

Posted 2013-08-29T16:18:47.743

Reputation: 5 051

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 – 2013-08-29T16:49:01.783

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 – 2013-08-29T16:57:01.543

Perfect!!! I did not see the update... Worked like a charm!! Thanks a lot :) – Abin – 2013-08-29T17:02:45.953