How can I write a command-line for the Aid4Mail Console (CLI) version?

Aid4Mail Console supports an array of command-line switches that you can use to configure mail processing tasks. The command line length should not exceed 2000 characters under Windows 7, Vista, XP and NT. You can define settings through an INI file to simplify and reduce the length of your command-line.

Aid4Mail Console can be run from batch files, the Windows Start/Run dialog, and any application that can execute other programs; conversion options can either be set through command-line switches, an INI file, or both.


Command-line syntax:

a4m.exe Source [Target] [/optional switches]

You can find information about your Source, Target and Switch options in the Aid4Mail Help File starting on page 93.


Command-Line Examples:

Example 1: Multiple PST files to EML message files and skipping all duplicate emails across all PST Files.

a4m.exe "C:\Users\<user>\Desktop\PST\*.pst" "C:\Users\<user>\Desktop\EML files" /eml /skipalldups="SkipDups.txt" /log="progress.txt" /errorlog="errors.txt" /IncludeTrash /IncludeUnpurged /unattended

Explanation of the command-line:

  • "C:\Users\<user>\Desktop\PST\*.pst" Converting all PST files from the PST folder on the desktop "Source"
  • "C:\Users\<user>\Desktop\EML files" Converted messages saved to EML Files folder on the desktop "Target"
  • /eml Converts source PST files to .eml message files
  • /skipalldups="SkipDups.txt" Creates log of emails processed and skips any emails that match in the log file. Saved in "Aid4Mail" folder in My Documents
  • /log="progress.txt" Creates a Progress log, saved in "Aid4Mail" folder in My Documents
  • /errorlog="errors.txt" Creates an Error Log, saved in "Aid4Mail" folder in My Documents (*error log only created if an error has occurred during processing)
  • /IncludeTrash Will process mail stored in the Trash, Junk, and Deleted folders
  • /IncludeUnpurged Will process moved and deleted items found in mailbox files and folders that haven´t been compacted or expunged
  • /Unattended Runs Aid4Mail without user intervention when an error occurs.


Example 2: PST to PST with content and date filters.

a4m.exe "C:\Users\<user>\Desktop\PST\Source.pst" "C:\Users\<user>\Desktop\FilterTest.pst" /skipalldups /UnicodePST /exclude="C:\Users\Josh Smith\Desktop\Wordlist.txt" /FilterScope=all /IncludeTrash /IncludeUnpurged /dr=2014/01/01-2014/12/31

Explanation of the command-line:

  • "C:\Users\<user>\Desktop\PST\Source.pst" Converting Source.pst as source file
  • "C:\Users\<user>\Desktop\Filtered.pst" Converting to Filtered.pst file
  • /skipalldups Skips any duplicate emails while processing
  • /UnicodePST Exports the source mail into a Unicode PST file (Outlook 2003 or newer).
  • /exclude="C:\Users\Josh Smith\Desktop\Wordlist.txt" Filters mail by contents based on the words listed in the specified file.Emails that contain any of the text criteria in the list are skipped during processing.
  • /FilterScope=all Use this switch if you have defined a Words List with the /Include or /Exclude parameters.Use the "All" value to search through both the email header and the message text.
  • /IncludeTrash Will process mail stored in the Trash, Junk, and Deleted folders
  • /IncludeUnpurged Will process moved and deleted items found in mailbox files and folders that haven´t been compacted or expunged
  • /dr=2014/01/01-2014/12/31 Only extracts mail that was received from January 1st, 2014 to December 31st, 2014.

More command-line examples can be found in the Aid4Mail Help File starting on page 129.


If you experience any issues, please don't hesitate to contact us by raising a ticket.

If you would like to buy an Aid4Mail license, visit the Aid4Mail website.

Did you find it helpful? Yes No
Aid4Mail is a trademark licensed to Fookes Software Ltd. Fookes is a registered trademark of Fookes Holding Ltd. All other trademarks and service marks, both marked and not marked, are the property of their respective owners.