# Problem with "Add Scheduled task"

**URL:** https://www.finalbuilder.com/forums/t/problem-with-add-scheduled-task/560
**Category:** Discussion
**Created:** [August 15, 2007, 12:58pm UTC](https://www.finalbuilder.com/forums/t/problem-with-add-scheduled-task/560 "2007-08-15T12:58:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [August 15, 2007, 12:58pm UTC](https://www.finalbuilder.com/forums/t/problem-with-add-scheduled-task/560/1 "2007-08-15T12:58:48Z")

</div>

&nbsp;

I'm trying to have a FinalBuilder script set up a scheduled task to run another FinalBuilder script every 20 minutes, but I keep getting this error:

&nbsp;

Command line : schtasks /Create /TN "FinalBuilder5 - testing task" /RU CORP\rc /RP \*\*\*\*\*\* /SC MINUTE /MO 5 /TR "C:\Program Files\FinalBuilder 5\FBCMD.exe" /o /p"C:\p4\_rc\depot\projects\inyo\scm\devel\sched\_test.fbp5" /ST 15:40:00  
ERROR: Invalid Argument/Option - '/o'.  
Type "SCHTASKS /CREATE /?" for usage.  
Action Failed  
C:\WINDOWS\system32\schtasks.exe returned : 1

&nbsp;

For my Task Executable I'm using: "C:\Program Files\FinalBuilder 5\FBCMD.exe"

For my Command Line Parameters: /o /p"C:\p4\_rc\depot\projects\inyo\scm\devel\sched\_test.fbp5"

The problem seems to be that schtasks is thinking the /o is a parameter to schtasks and not to FBCMD.&nbsp; Am I doing something wrong?

Thanks,

&nbsp;&nbsp; Keith

&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [August 16, 2007, 5:41am UTC](https://www.finalbuilder.com/forums/t/problem-with-add-scheduled-task/560/2 "2007-08-16T05:41:41Z")

</div>

From a bit of testing, it seems possible to do what you want if you set the quotes correctly.   
 Perhaps somethnig like this:   
 schtasks /Create /TN “FinalBuilder5 - testing task” /RU CORP\rc /RP \*\*\*\*\*\* /SC MINUTE /MO 5 /TR “C:\Program Files\FinalBuilder 5\FBCMD.exe /o /pC:\p4\_rc\depot\projects\inyo\scm\devel\sched\_test.fbp5” /ST 15:40:00   
  
 Or even:   
  
 schtasks /Create /TN “FinalBuilder5 - testing task” /RU CORP\rc /RP \*\*\*\*\*\* /SC MINUTE /MO 5 /TR “C:\Program Files\FinalBuilder 5\FBCMD.exe /o /p”“C:\p4\_rc\depot\projects\inyo\scm\devel\sched\_test.fbp5"” /ST 15:40:00   
  
 If that gets too complicated, try creating a batch file with the fbcmd call, and simply call that: /tr “c:\builds\build1.bat”   
  
 Finally, don’t forget that FinalBuilder has support for the windows scheduler directly from the Tools menu - you don’t really need to be calling the scheduler from the command line in most cases.   
  
 Steve

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [August 16, 2007, 7:50am UTC](https://www.finalbuilder.com/forums/t/problem-with-add-scheduled-task/560/3 "2007-08-16T07:50:51Z")

</div>

Hi Keith,   
  
 Sorry for the delay in getting back to you. Thanks for the extra support info, Steve.   
  
 There was a bug quoting the arguments to schtasks, but it’s been fixed in the latest test build. Here’s a download link:   
  
 [https://www.finalbuilder.com/downloads/finalbuilder/550/FB550\_375.exe](https://www.finalbuilder.com/downloads/finalbuilder/550/FB550_375.exe)   
  
 Regards,   
  
 Angus

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [September 19, 2007, 1:17am UTC](https://www.finalbuilder.com/forums/t/problem-with-add-scheduled-task/560/4 "2007-09-19T01:17:33Z")

</div>

Sorry to take so long getting back to you, too Angus. I've finally had a chance to try out your build and it works nicely. Thanks!

&nbsp; Keith
