Batch file works well from FFS but not from Task Scheduler

Get help for specific problems
Posts: 3
Joined: 11 Aug 2017

Bob_Hatcher

I have a batch file to sync with an external drive nightly that works just fine when I open FFS and run it there. But, when it tries to run from Task Scheduler it comes back with an error "Cannot find file "filename". Opening Task Scheduler and trying to run it there gives the same error message.

Any help is appreciated.

Bob
Posts: 32
Joined: 11 Jul 2016

schnappi

Post what you have verbatim in the task scheduler for "Program/script" and "Add Arguments"

Probably missing " " (quotation marks). A command needs quotes if there is a space in them. C:\Program Files\test.exe won't work while "C:\Program Files\test.exe" will.
Posts: 3
Joined: 11 Aug 2017

Bob_Hatcher

For the Program it is: "C:\Program Files\FreeFileSync\FreeFileSync.exe"

For the arguments it is: g:\SyncCOneDrivetoGMyDocuments.ffs_batch

I've tried moving the batch file to a few different locations because the error message I get is: "The directory name is invalid" which is an ambiguous message as I can't figure out if they are referring to the program name or the batch file name.

Bob
FFSImage.jpg
FFSImage.jpg (63.52 KiB) Viewed 722 times
User avatar
Posts: 2291
Joined: 22 Aug 2012

Plerry

Drive-letter mappings (in casu: "g:") are user specific.
Make sure that for the specific user credentials under which the scheduled task is run,
a drive letter mapping g: is defined, points to the proper location and has at least read access there.
Or, change the user credentials under which the scheduled task is run into one for which
a drive letter mapping g: is defined, points to the proper location and has at least read access there.