Running V9.2 on a Windows Server 2012 x64 install.
When I try and execute a ffs_batch file using the command line, I am finding that FreeFileSYnc returns immediately, and not at the completion of the task.
If I execute the following in a command prompt window:
"C:\Program Files\FreeFileSync\FreeFileSync.exe" C:\scripts\SyncWAFS.ffs_batch
The program returns immediately with ErrorLevel 0.
In Task Manager, I can see then that in fact the process has started and that it has spawned the x64 version.
The running processes run to completion and actually execute the batch job.
However, this execution is done Asynchronously.
The documentation shows that the process should by synchronis, and that it blocks until the task completes, returning the execution status in the ErrorLevel variable.
What am I doing wrong?
Calling via Command Line returns immediatley
- Posts: 1
- Joined: 29 Jul 2017
- Posts: 31
- Joined: 26 Nov 2017
I'm having this save issue. Zenju can you help?
- Site Admin
- Posts: 7211
- Joined: 9 Dec 2007
Can you be more precise regarding "same issue" and provide some more details? Or maybe even steps to reproduce?
- Posts: 292
- Joined: 13 Apr 2017
Try:
start /wait "C:\Program Files\FreeFileSync\FreeFileSync.exe" C:\scripts\SyncWAFS.ffs_batch
start /wait "C:\Program Files\FreeFileSync\FreeFileSync.exe" C:\scripts\SyncWAFS.ffs_batch
- Posts: 31
- Joined: 26 Nov 2017
I'm not sure how more specific you want me to be. I'm saying that I have the same exact issue that the OP has.Can you be more precise regarding "same issue" and provide some more details? Or maybe even steps to reproduce? Zenju, 27 Nov 2017, 17:01
I open a command prompt.
I type this command exactly as pasted here: C:\Users\shai>"C:\Program Files\FreeFileSync\FreeFileSync.exe" "C:\bin\freefilesync\Drives C and X to W.ffs_batch"
It immediately exists and returns to the command prompt. It won't "wait" until the sync is complete.
The errorlevel from it is always 0. Since it doesn't wait for the sync to finish and evaluate the exit code of the sync.
- Posts: 31
- Joined: 26 Nov 2017
also, perhaps this is expected behavior by CMD? And what Gianni1962 above said is how to correctly start a job in command line without it returning to command prompt instantly after execution?
The documentation does say "You can evaluate these codes from a script (e.g. a cmd or bat file on Windows) and check if synchronization completed successfully" and indeed, in a batch script this works as expected.
The documentation does say "You can evaluate these codes from a script (e.g. a cmd or bat file on Windows) and check if synchronization completed successfully" and indeed, in a batch script this works as expected.
- Site Admin
- Posts: 7211
- Joined: 9 Dec 2007
Indeed, this seems to be the case.also, perhaps this is expected behavior by CMD? And what Gianni1962 above said is how to correctly start a job in command line without it returning to command prompt instantly after execution? shai, 27 Nov 2017, 18:42
- Posts: 31
- Joined: 26 Nov 2017
Case closed IMHO :)
- Posts: 31
- Joined: 26 Nov 2017
Also, it might be worth while, since it has come up, to add this to the documentation for future reference. I'm sure someone else would RTFM and come here afterwards.