DBXanalyzer Home DBXcmd Command-Line Utility

DBXanalyzer now ships with a separate utility DBXcmdTM that can be called via the command line (i.e. in MS-DOS mode).

You can use DBXcmd to create a list of messages in a variety of formats, including CSV, or export the messages in EML (TXT) format to a target directory. You can call the utility from a batch file or have the Windows Scheduler run the batch file every night, for example, to backup certain messages from your DBX files.

Contents

Help

To see the syntax and the complete list of options type

dbxcmd -? | more

Quick Syntax

Usage: DBXCMD [[-l]|-e|-?] [options] dbxfile [outpath]
where:
-l List messages (default action) to file <outpath> (default=console)
-e Export message files to directory <outpath> (default=CWD)
-? Display this help and quit

Examples

dbxcmd -l "C:\EmailData\inbox.dbx"
will list all messages in the DBX file inbox.dbx in the folder C:\EmailData on the console with a complete set of tab-delimited fields. Note the option is a lower-case letter L for List.
dbxcmd "C:\EmailData\inbox.dbx"
will do the same as the previous example because -l (list) is the default option.
dbxcmd -e "C:\EmailData\inbox.dbx"
will export all messages in the DBX file to the current working directory as .EML files. You will be prompted before any existing files are overwritten. The output files will have names of the form "Re_ The Subject Line" i.e. the subject line with any illegal filename characters replaced by "_", possibly with "{1}" appended if the same name already exists in the current set. (Hint: Add the -g option to guarantee not to overwrite an existing file of the same name.)
dbxcmd -e "C:\EmailData\inbox.dbx" "C:\mybackup\emails"
will do the same but to the output directory C:\mybackup\emails.
dbxcmd -e -y "C:\EmailData\inbox.dbx" "C:\mybackup\emails"
will do the same but will overwrite any existing files of the same name without prompting.
dbxcmd -e -g "C:\EmailData\inbox.dbx" "C:\mybackup\emails"
will do the same but guarantees to create unique filenames and not overwrite any existing files in C:\mybackup\emails.
dbxcmd -e -pw "C:\EmailData\inbox.dbx" "C:\mybackup\emails"
will export all messages with filenames in the format 20041231235959_ReTheSubjectLine, i.e. with a prepended date-time of receipt and all white space and punctuation characters in the subject line removed.
dbxcmd -e -j "C:\EmailData\inbox.dbx" "C:\mybackup\emails"
will export all messages with filenames in the format 20041231235959, i.e. with just the date-time of receipt.
dbxcmd -e -a2004-12-31 "C:\EmailData\inbox.dbx" "C:\mybackup\emails"
will export all messages received on or after 31 December 2004.
dbxcmd -e -b2005-01-15 "C:\EmailData\inbox.dbx" "C:\mybackup\emails"
will export all messages received on or before 15 January 2005.
dbxcmd -e -a2004-12-31 -b2005-01-15 "C:\EmailData\inbox.dbx" "C:\mybackup\emails"
will export all messages received between 31 December 2004 and 15 January 2005 inclusive.
dbxcmd -e -a#10 "C:\EmailData\inbox.dbx" "C:\mybackup\emails"
will export all messages received on or after ten days ago based on the system clock and local time.
dbxcmd -e -a#0 "C:\EmailData\inbox.dbx" "C:\mybackup\emails"
ditto but just for today.
dbxcmd -e -xTXT "C:\EmailData\inbox.dbx" "C:\mybackup\emails"
exports all messages with a file extension of .TXT instead of .EML.
dbxcmd -l "C:\EmailData\inbox.dbx" "C:\mylists\inbox_list.txt"
will create a list file C:\mylists\inbox_list.txt in tab-delimited format.
dbxcmd -l -c "C:\EmailData\inbox.dbx" "C:\mylists\inbox_list.csv"
will create a list file C:\mylists\inbox_list.csv in CSV format - this format can be read directly by Microsoft Excel.
dbxcmd -l -ch "C:\EmailData\inbox.dbx" "C:\mylists\inbox_list.csv"
ditto with a header line.
dbxcmd -l -ch -a#0 "C:\EmailData\inbox.dbx" "C:\mylists\inbox_list.csv"
ditto but only list messages received today (i.e. on or after zero days ago).
dbxcmd -l "-s|" "C:\EmailData\inbox.dbx" "C:\mylists\inbox_list.txt"
will create a list file with fields separated by the vertical line character "|". Note the quotes around the option.
dbxcmd -l -ufedm "C:\EmailData\inbox.dbx" "C:\mylists\inbox_list.txt"
will create a list file with only the columns: From, sender's Email address, Date received, and Message ID.

Using in a Batch File

Create a batch file called, say, dbxbackup.bat with this one line in it:-

FOR %%f IN ("C:\Email Data\*.dbx") DO dbxcmd -e -g -pw -a#0 "%%f" "C:\mybackup\emails"

This batch file will create a backup of all messages received today in all DBX files in the directory C:\Email Data as unique EML files in the directory C:\mybackup\emails. Note the use of the double "%%" in batch files for variables. You could use Windows Scheduler to run this batch file at, say, 11:55 p.m. each day.

Explanation of options in this example

-e Export messages
-g with Guaranteed unique filenames in output directory
-pw with date-time received Prepended to output filename and all Whitespace and punctuation characters stripped from the subject line
-a#0 received on or After zero days ago, i.e. today in system local time

Full Syntax

This is DBXCMD Licensed Version 1.1.2 (Feb 25 2008)
Copyright (C) 2005-8 DI Management Services Pty Ltd <www.di-mgt.com.au>
Usage: DBXCMD [[-l]|-e|-?] [options] dbxfile [outpath]
where:
-l List messages (default action) to file <outpath> (default=console)
-e Export message files to directory <outpath> (default=CWD)
-? Display this help and quit
GENERAL options:
-y suppress prompting before overwriting a file
-d Dumb mode ie no output except errors
-- subsequent parameters are not options
FILTER options on messages to be listed/exported:
-a<date> on or After date yyyy-mm-dd, eg -a2004-12-31
-b<date> on or Before date
-o<date> On the specified date
-a#<n> on or After <n> days ago, eg -a#10
-b#<n> on or Before <n> days ago
-o#<n> On the day <n> days ago
EXPORT options:
-x<ext> use <ext> as file eXtension (default=EML) eg -xTXT
-m Make new directory without prompting
-g Guarantee a unique filename in output directory
-p Prepend date-time received to output filename
-j Just use date-time with no subject for output filename
-w remove Whitespace and other punctuation characters from filename
LIST options:
-h include Header as first line (default=no header)
-c output in CSV format (default=tab delimited)
-s<char> use <char> as field Separator (default tab) eg -s;
-q Quote strings with quotation marks (default no quote)
-u<colcodes> list colUmns as per column codes (see below)
-u* = list all columns in default order (default)
COLUMN CODES in default order:
i Index number
f From name
s Subject
a Attachments Y/N
d Date received
k size in KB
p Priority
r to Recipient
t sent To
v account serVer
m MessageID
o Output filename
z filesiZe in bytes
e sender Email address
c reCipient email address
  eg -uefs lists columns (senderEmail,From,Subject)
Notes:
1. Specify dates in ISO format yyyy-mm-dd
2. Quote parameters with `special' chars eg "-s|"
   and with spaces eg "C:\My Documents"
For more info see <http://www.di-mgt.com.au/dbxanalyzer/dbxcmd.html>

Notes

Problems

Any comments, feedback, questions to our email or use our Contact Page.

This page last updated: 11 October 2008


Valid HTML 4.01 Strict Valid CSS