Command Line Usage to Encrypt/Decrypt a File

This topic describes parameters of Database Tour command line, specific to encrypting or decrypting files.

See also common rules for writing command lines.

You can start with this simple example:

dbtour.exe /encrypt "/SrcFile=c:\my db\customer.dbf" "/TrgFile=c:\my db copy\customer.enc" "/password=MyPass"

Here, you encrypt your customer.dbf file using password MyPass and save the encrypted file as customer.enc.

Don't want to hand-write switches? See the next section and build the command line easily from Database Tour GUI.

Or keep reading to know to learn all the switches and parameters.

Building Command Line in a Few Clicks

Advanced users can build the needed command line manually using the specification below.

But if you are a beginner or need to create a command line or action file without learning the details, use the Database Tour Command Line Builder.

Usage

Classic command line format

The command line consists of all needed switches and parameters:

dbtour.exe /Parameter1 /Parameter2 /... /ParameterN

Short command line format

This format is more flexible as it allows you to keep all command line parameters in a separate action file. The command line consists of the /ActionFile parameter (which points to the action file path) and an optional /silent parameter:

dbtour.exe [/silent] /ActionFile=ActionFileName

Command line options and their descriptions

Main command

/encrypt | /decrypt

Tells the application to encrypt or decrypt a file. Required parameter for this command line type.

Control parameters

/silent

Run the application in 'silent' mode, without any windows (except purchase reminder when the application is used without registration after the test period). When using /ActionFile option, /silent switch must be outside parameters file. The Database Tour returns an exit code of 0 if the working was successful, 1 if the command line parameters were invalid, or 2 if the working failed. Attention! There are no overwrite or other prompts in this mode.

/ActionFile=Value

Name of the action file, which contains command line parameters, one parameter per line. Lines with a semicolon at the beginning are ignored as comments. Blank lines are allowed. When using this option, there should not be other command line parameters in the command line except /silent switch. If the file name includes spaces, enclose entire parameter in quotes. See example.

Source, target, and password

/SrcFile=Value

Name of an existing file to encrypt or decrypt. If the file name includes spaces, enclose entire parameter in quotes.

/TrgFile=Value

Name of a target (encrypted or decrypted) file. If the file name includes spaces, enclose entire parameter in quotes.

/Password=Value

Password, which must be used to encrypt or decrypt the source file. If the password includes spaces, enclose entire parameter in quotes.

Behavior switches

/CloseWhenDone

Close the application after successful execution. This option is ignored in 'silent' mode where the application is closed automatically anyway.

/CloseOnError

Close the application when error occurs during execution. This option is ignored in 'silent' mode where the application is closed automatically anyway.

/minimize

Start the application in minimized mode. It is restored to normal mode on error or after ending execution (if /CloseWhenDone switch is not used). This option is ignored in 'silent' mode where the application runs without any windows.

Examples

  • Encrypt a file:

    dbtour.exe /encrypt /CloseWhenDone "/SrcFile=c:\my db\customer.dbf" "/TrgFile=c:\my db copy\customer.enc" "/password=MyPass"

    Database Tour will encrypt customer.dbf in GUI mode, save encrypted file as customer.enc, and exit.

  • Decrypt a file:

    dbtour.exe /silent /decrypt "/SrcFile=c:\my db copy\customer.enc" "/TrgFile=c:\my db copy\customer.dbf" "/password=MyPass"

    Database Tour will decrypt customer.enc in silent mode and save decrypted file as customer.dbf.

  • The same as the previous one but using an action file:

    dbtour.exe /silent "/ActionFile=c:\DBTourStartParameters.txt"

    The contents of c:\DBTourStartParameters.txt file should be like the following:

    ;action
    /decrypt
    ;options
    /password=MyPass
    ;source definition
    /SrcFile=c:\my db copy\customer.enc
    ;target definition
    /TrgFile=c:\my db copy\customer.dbf