Syntax of batch in Windows Task Scheduler

Discuss new features and functions
Posts: 10
Joined: 24 Sep 2012

bronowski

I'm having problems making a batch file run in Windows Task Scheduler. I am
unclear what the exact syntax of this should be.
In the "Create Batch Job" section of the FreeFileSync program, the example
syntax says:
FreeFileSync.exe <job name>.ffs_batch
I have a job called SyncCurrentSheet.ffs.batch, so I have placed this in the
same directory as the FreeFileSync program, and entered this in the Task
Manager:
C:\ProgramFiles\FreeFileSync\FreeFileSync.exe SyncCurrentSheet.ffs.batch
and this in the Start In field:
C:\ProgramFiles\FreeFileSync\
But surely the name of the program to execute is just this on its own:
SyncCurrentSheet.ffs.batch
and I can have this anywhere in my hard drive, so I should be writing in the
task manager program instead:
C:\users\username\myfiles\SyncCurrentSheet.ffs.batch
and the path for this is:
C:\users\username\myfiles\

None of these work in the task scheduler, it doesn't matter where I put the
batch file, I have tried it in the same directory as the program, and in my
own folders, with no result. The batch file works by invoking it directly.

So,would one of you kindly tell me the exact syntax of the command to put in
the Task Manager, and whether the batch file can be in a separate directory
from the program.
Posts: 10
Joined: 24 Sep 2012

bronowski

...Update: I put a point instead of an underline in the file names here. This
was not wrong in the actual files.
User avatar
Site Admin
Posts: 7052
Joined: 9 Dec 2007

Zenju

Yes, Windows Task planner is probably not the simplest tool to setup, see the
help file chapter "Schedule a Batch Job" for details how to setup.
Posts: 10
Joined: 24 Sep 2012

bronowski

I've abandoned WTS now, it always was a waste of time for doing any task.
I'm having a go at RealtimeSync now, which seems to work once and then fail,
see my thread in the other forum.
Posts: 1
Joined: 10 Jul 2005

d_kourtesis

I am posting this here just in case it helps someone in a similar situation.

To schedule execution of the batch file that FreeFileSync generates with the Windows Task Scheduler I have found the following settings for the 'Action' tab of the Task to work best.

Actions: Start a program
Program/script: cmd
Add arguments (optional): /c start "" "C:\FreeFileSync\Batchfiles\Nightly.ffs_batch"

Note the empty quotes ("") placed before the path to your FFS batch file.