Batch File not working

Get help for specific problems
Posts: 4
Joined: 5 Feb 2023

en8scl

Hi

Have recently upgraded to latest version and my batch files have stopped working

If I run the batch commans in powershell I get the following:

PS C:\Users\stuar> "C:\Program Files\FreeFileSync\Bin\FreeFileSync_x64.exe" "D:\FreeFileSync\BatchRun-Shared-Videos_new.ffs_batch"
At line:1 char:58
+ ... eSync_x64.exe" "D:\FreeFileSync\BatchRun-Shared-Videos_new.ffs_batch"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token '"D:\FreeFileSync\BatchRun-Shared-Videos_new.ffs_batch"' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
Posts: 936
Joined: 8 May 2006

therube

If you run the same from a C: prompt, does it work?
What OS?
Recent OS "upgrade"?

And to be clear, this has worked for you in the past?
Last edited by therube on 06 Feb 2023, 20:28, edited 2 times in total.
Posts: 4
Joined: 5 Feb 2023

en8scl

Hi

Yes was working until I upgraded to latest version (not sure what the previous version was)
I'm on Windows 10 Pro Version 22H2 OS Build 19045.2546 with Windows Feature Experience Pack 120.2212.4190.0

I have tried moving the config file to be on the c: drive and that's made no difference
Posts: 936
Joined: 8 May 2006

therube

In PS (in Win7, FFS 12.0), using a full path to the program, I am not getting things working.
(I'm not familiar with PS.)

If I start PS in the /FFS/ directory, then only use (& the .\ is seemingly needed)
.\freefilesync <pathto.ffs_batch>
then it does work.
Posts: 4
Joined: 5 Feb 2023

en8scl

yep - that works - so how do I set that up in windows task scheduler?

The config shown in the pdf of instructions on page 22 doesn't work - the process runs but never finishes and makes an annoying alert sound to signify its still running - can see process in task manager but it never appears in task bar
Posts: 6
Joined: 17 Mar 2023

entdgc

I am seeing the exact same problem as en8scl. I am now trying to setup in task scheduler (win10) and have changed my previously working setup from "C:\Program Files\FreeFileSync\FreeFileSync.exe" to just .\FreeFileSync.exe but set the startup directory to "C:\Program Files\FreeFileSync\". Still doesnt work. I reiterate this was working fine a few weeks back - I have only just noticed it wasn't working. As you said in powershell if I CD to the FFS directory and execute the command .\FreeFileSync.exe "C:\Users\David\Documents\GPLBackup.ffs_batch" it works (but not if I add quotes ".\FreeFileSync.exe")
Any suggestions?
User avatar
Site Admin
Posts: 7042
Joined: 9 Dec 2007

Zenju

Power shell has a different syntax than the command prompt. If you want to test syntax in order to set up Windows task scheduler, you need to use the command prompt ("cmd").
Posts: 6
Joined: 17 Mar 2023

entdgc

Thanks for your reply Zenju. If I enter the command in 'cmd' with quotes it works. However it does not work via Task Scheduler. After some investigations the only way I can get it to work via Task Scheduler is to install FFS into the route directory i.e. no spaces in the folder/file name. It appears as though there may be some problem with the way FFS handles spaces in folder/file names as other programs SEEM to work correctly.
User avatar
Site Admin
Posts: 7042
Joined: 9 Dec 2007

Zenju

The syntax detailed in the manual should work: https://freefilesync.org/manual.php?topic=schedule-batch-jobs#windows
Posts: 4
Joined: 5 Feb 2023

en8scl

I agree with entdgc it doesn't behave as per manual when there are spaces in the file path name...
User avatar
Site Admin
Posts: 7042
Joined: 9 Dec 2007

Zenju

Screenshots? Error messages?
User avatar
Posts: 3555
Joined: 11 Jun 2019

xCSxXenon

I agree with entdgc it doesn't behave as per manual when there are spaces in the file path name... en8scl, 19 Mar 2023, 16:37
Working for me. The quotations is what allows spaces in the path to be interpreted correctly
Posts: 6
Joined: 17 Mar 2023

entdgc

Yes I know it should work as per manual as that is what I followed originaly and it worked happily for many months. Only recently has it stopped working but I did not notice it had failed for some weeks so cant say whether a windows update caused the error or an FFS update? There is no error message given it simply fails. If I go into Task Scheduler and try and run the task again it just fails - FFS does not even flash up on the screen. I have tried adding '> error.txt' to the arguments but I just get an empty file. The only way I could get it to work was to instal FFS directly below the route directory. I am happy to do this and as others seem to find it works without this it must be installation specific. For completenes I am running Win10 Home 64bit vs 19045.2728 FFS vs 12.1. I would suggest we all just monitor the situation for now...