How to use the command line application

This article applies only to Backup4all. If you don't have it yet, you must download it first.

Download Now Buy Licenses
Jul 25, 2019

Backup4all 4.x

We strive to keep our articles as accurate as possible. If you notice any inconsistencies or outdated info please let us know.

How to use the command line application

Since version 5 of Backup4all, all actions are executed in command line. The interface is also available and you can see the progress in interface. The difference is that now there is a easier process with a single application, no need to set up a different command line application.

In version 4 of Backup4all exists B4aCmd (the command line application of Backup4all) which is a small application that runs independently from the main application. It can be used to create batch files. Also if your One Touch Backup button device is not detected by Backup4all) Backup4all is not natively compatible with the device), you could use the command line parameters to create a command that can be associated to the One Touch Backup button of your device. When executed without any parameters it displays the usage information.


B4aCmd [{/f|/d|/i|/r|/e|/t|/c|/x}] name | /g group | /otb

Formatting legend

Italic - Information that must be supplied by the user

Bold - Elements that the user must type exactly as shown

/ - Switches are preceded by slash

[] - Elements between square brackets are optional

| - Vertical line separates possible choices

{} - Items between braces are a set of choices from which the user must choose only one

Command line backup can have as parameters an ".ini" file (with its full path), a ".bkc" file (with its full path) or the name of the backup job. The ".ini" or ".bkc" file must exist in the specified path, the backup job must be defined in Backup4all or otherwise the backup will not run.

Switches that apply to this parameter (case insensitive, preceded by "/" or "-"):

  • /f - force the execution of a full backup
  • /d - force the execution of a differential backup
  • /i - force the execution of an incremental backup
  • /r - execute the backup with its defined type (this is the default behavior when the backup name is specified without switches)
  • /e - erase the disc(Floppy/CD/DVD/Blu-ray) before backup
  • /t - starts the test operation for the named job. Supports also an additional parameter [/TN 1,2,5..20|*|#] - if no TN is set then it will test all backup jobs same as using *; if # is used it will test only the last backup job (# can be used in the same time with other numbers too).
  • /c - deletes the .bkc file and all zip files associated with the named backup job
  • /x - clean the backup. Supports additional parameters:
    • [/IE mm.dd.yyyy] - clean the backups older than the specified date
    • [/IS mm.dd.yyyy] - clean the backups newer then the specified date
    • [/OT n /OTU {D|W|M|Y}] - n is the number of days (D), weeks (W), months (M) or years (Y)
    • [/KD] - keep Differential backups
    • [/KF] - keep Full backups

If the backup job to be executed has the backup type set to Mirror, then a mirror backup will be performed and the "/f", "/d", "/i" switches will be ignored even if they are set.

You can also have as parameter an existing backup group. This group must be defined in Backup4all, otherwise the backup will not run.

Switch to apply to this parameter (case insensitive, preceded by "/" or "-"):

  • /g - execute the jobs in the backup group with their defined types (the switch is mandatory if you want to execute a backup group)

When called without parameters, but with the "/otb" switch, Backup4all executes the backup job or backup group specified in the OTB settings (from the Tools -> Options -> One Touch Backup page of Backup4all).


To force a full backup on the backup job associated with the IE Favorites.bkc located in the "E:\Backup Destination" folder, use:
B4aCmd /f "E:\Backup Destination\IE Favorites.bkc"

To force an incremental backup on the My Documents backup job, use:
B4aCmd /i "My Documents"

To execute all backup jobs from the Samples group, use:
B4aCmd /g Samples

To execute the backup job or backup group associated with the One Touch Backup, use:
B4aCmd /otb

To execute a test for all backup numbers of the My Pictures backup job
B4aCmd /t "My Pictures" /tn *

To execute a test for first two and last backup number of the My Pictures backup job
B4aCmd /t "My Pictures" /tn 1,2,#

To clean all backup versions older than two weeks and keep the full and differential backups of the My Pictures backup job, use:
B4aCmd /x "My Pictures" /OT 2 /OTU W /KF / KD

Backup4all returns exit codes after each task execution (backup, independent test or cleanup).

As a general case, if the backup was successful, the exit code is 0, otherwise is different.

Here are the possible exit codes:

  • if backup was successful, the exit code is 0
  • if there are parameter errors or syntax errors, the exit code is 1
  • if backup was aborted, the exit code is 2
  • if backup was finished with warnings, the exit code is 3
  • if the independent test was finished with errors, the exit code is 4
  • if cleanup was finished with errors, the exit code is 5

Backup job definitions (".ini" files) are saved separately for each Windows user. These files can be found in the "Application Data\Softland\Backup4all 4\IniFiles" folder of your user profile (if it's not changed in the Tools -> Options -> File locations window). Backup catalogs (".bkc" files) are saved locally and in the backup destination together with the backup files. When a backup job is executed for the first time, a .bkc file is created. There is only one .bkc file for each backup job.

If the parameters are not valid you will be shown the start screen with an appropriate error message. When valid parameters are provided with valid switches B4aCmd will execute the commands. There is a progress meter showing the progress of the backup execution in percents. When the backup finishes and if you have the Test after backup option enabled, then the test operation starts with its own progress.

The command line application uses the same engine, same configuration files and the same log files as the main application. It always performs an unattended backup. You can use Backup4all's interface to define backup jobs and backup groups which can be used later as parameters for the command line application. You can create a shortcut to a backup job or to a backup group so you won't have to use complicated paths. To create a shortcut, use the Create Shortcut menu item from the File menu.

The same license is valid for the command line application as for the main application. Once the main application is licensed the command line application automatically recognizes the license.

Applies to

Backup4all 4.x