FcAdminTools command line compact, backup and zip to archive

Created by Jeremy Burgess, Modified on Tue, 1 Feb, 2022 at 4:38 PM by Jeremy Burgess

The following is an example Windows batch file for automating the following actions on an ABBYY FlexiCapture project:

  1. Compact all projects on the server
  2. Download all projects to a local path
    • A rem'd section details how to download only a specific project
  3. Zip the downloaded project(s) into a folder based on today's date, remove files after zipping

Usage example:

@echo off

set server=http://localhost/
set today=%date:/=%
rem Possible values are  All, LayoutOnly, ClassifierOnly, None 
set copyTrainingBatches=All

rem Possible values are [blank] or /CopyTrainingSamples
set copyTrainingSamples=/CopyTrainingSamples

set backupPath=d:\wfd\developer\backups\%today%
mkdir "%backupPath%"

set exePath="C:\Program Files\ABBYY FlexiCapture 12 Stations\fcadmintools.exe"

rem Compact all projects first (removes unused docdef, etc)
echo Compacting
%exePath% CompactProject /Server="%server%" > "%backupPath%\Log-compact.txt"

rem Download all projects (one folder for each)
echo Downloading to %backupPath%

rem Specific project (example ID:1, project folder: projectX)
rem mkdir "%backupPath%\projectX"
rem %exePath% DownloadProject /Project="%server%/1/" /Target="%backupPath%\projectX" /CopyTrainingBatches="%copyTrainingBatches%" %copyTrainingSamples% > "%backupPath%\projectX\Log-download.txt"

rem All projects
%exePath% DownloadProject /Server="%server%" /Target="%backupPath%" /CopyTrainingBatches="%copyTrainingBatches%" %copyTrainingSamples% > "%backupPath%\Log-download.txt"

rem Zip the backup
echo Zipping %backupPath%
"C:\Program Files\7-Zip\7z.exe" a -r -sdel "%today%" "%backupPath%\*"
rmdir "%backupPath%"
echo Zipped

:end
echo Complete

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article