Database Tour Documentation Contents Index

Command Line Usage: Encrypt / Decrypt a File

Top Previous Next

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

Common rules for writing command lines are described here.

Before you start...

Advanced users can build the needed command line manually using the specification below. But if you are a beginner or just need to create a command line for simple operation, you can save your time using Database Tour command line builder. To generate a command line, choose 'Tools | Generate Command Line | Encrypt a File...' or 'Tools | Generate Command Line | Decrypt a File...' menu. In 'Generate Command Line' window, specify needed options and click OK. A new window will appear with the command line generated. Copy it, correct it if it is needed, and use in Database Tour calls from your own programs, .bat files etc.

Usage (specification):

Long (classic) format:
    dbtour.exe [/silent] [/e[ncrypt] | /d[ecrypt]] [/SrcFile=SourceFileName] [/TrgFile=TargetFileName] [/password=password] [/CloseWhenDone] [/CloseOnError] [/minimize]
     
Short format (parameters are excluded from the command line and included in the action file):
    dbtour.exe [/silent] [/ParamsFile=ActionFileName]

Examples:

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

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

3. The same as the previous one but using an action file
dbtour.exe /silent "/ParamsFile=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

Description of the options:

Option Description
/encrypt Tells the program to encrypt a file.
/decrypt Tells the program to decrypt a file.
/silent This switch will run the program in "silent" mode, without any windows (except purchase reminder when the program is used without registration after the test period). When using /ParamsFile 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.
/ParamsFile Specifies the 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, entire parameter must be enclosed in quotes. See example 3.
/SrcFile Specifies the name of an existing file to encrypt or decrypt. If the file name includes spaces, entire parameter must be enclosed in quotes.
/TrgFile Specifies the name of a target (encrypted or decrypted) file. If the file name includes spaces, entire parameter must be enclosed in quotes.
/password Specifies password, which must be used to encrypt or decrypt the source file. If the password includes spaces, entire parameter must be enclosed in quotes.
/CloseWhenDone Forces the program to close itself after successful execution. This option is ignored in "silent" mode where the program is closed automatically anyway.
/CloseOnError Forces the program to close itself when error occurs during execution. This option is ignored in "silent" mode where the program is closed automatically anyway.
/minimize Program starts 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 program runs without any windows.