Non-paralell batch processing

Get help for specific problems
Posts: 3
Joined: 13 Jun 2003

maltic

Hello,

I am using a batch for synchronizing folder A with folder B (update only) and then folder B with folder C (automatic). Folder A contains templates which should be only applied when they change. Unfortunately this doesn´t seem to work 100% and I think that batch processing is done parellel. Is this correct? Is there any way to sync A with B first and then after the first job finishes sync B with C? I cannot create two batches, because the batch is triggered using the registry RUN key and these are also started parallel.

Thanks in advance.

Cheers,
Malte
Posts: 141
Joined: 10 Sep 2009

srjones67

Create a batch file that runs one sync then checks for first sync success before running second sync. Have this batch called by your registry RUN command.
Posts: 28
Joined: 6 Aug 2013

petrovski80

srjones67 is right. I'd use batch scripting to achieve what you want. Example:

@ECHO OFF
"C:\Program Files\FreeFileSync\FreeFileSync.exe" "C:\path\to\first_batch"
if errorlevel 1 (
echo Errors occurred during synchronization of first batch...
pause
exit
)
"C:\Program Files\FreeFileSync\FreeFileSync.exe" "C:\path\to\second_batch"
if errorlevel 1 (
echo Errors occurred during synchronization of second batch...
pause
exit
)
echo Both batch files executed OK! :-)
pause
exit
Posts: 3
Joined: 13 Jun 2003

maltic

Hm - ok. I do not like the batch file - or better the CMD window - to be shown since the process can take a longer time over dial up lines. So I might have to programm a short wrapper to start the FreeFileSync. Not really want I WANT to do, but perhaps this is the only solution. Thanks for your help!
Posts: 3
Joined: 13 Jun 2003

maltic

I tried this out, unfortunately FreeFileSync itself is started asynchrounously. SO the batch file does not stop until the first sync job is over ... any ideas?
Posts: 28
Joined: 6 Aug 2013

petrovski80

So your .bat is executing OK but you simply do not want to see the CMD window right? There are several ways:

1) If you have scheduled the .bat file to be executed via Windows Task Scheduler, you can hide the CMD window by specifying a different Windows account for the task (SYSTEM, NETWORK SERVICE, etc.) OR by selecting the radio button "Run whether user is logged on or not". PS: the check box "hidden" does not hide the CMD window.

2) If you start the .bat file manually, the only way to completely hide it is by calling it from other scripts or programs AFAIK. In that cause you could use a .vbs script for example to start a .bat hidden that will start the two FFS batches. Personally I would use a scripting tool such as AutoIT in this case to start the FFS batches instead of Windows batch scripting if not seeing the CMD window is that important.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

> you could use a .vbs script for example

For example "HideConsole.vbs" located in the FFS installation directory.

> the batch file does not stop until the first sync job is over

It works for me...