Command Line Switches

Outlook True Archive – Command Line Switches

OTA can operate unattended via command line switches. You may find it useful to run OTA from your favourite Windows Scheduler so that archive tasks are performed at regular intervals.

Enclose all parameters in double quotation marks (ASCII 34) where parameters may include spaces, such as in file names, folder names, paths, subject selections, etc. See examples below.

The following command line parameters are available:

/Auto

Perform an automated task. You must use this switch in order to run OTA in unattended mode.

/T

The task to perform. Use A for Archive, C for Copy, D for Delete, e.g. /T:A

/SA

The source archive. Specify the name of a PST as it appears in the “Source” dropdown list of the OTA screen. E.g. /SA:”Personal Folders”

/SF

Specifies the source folder if you are archiving from a folder instead of from a PST file. E.g. /SF:”C:\MyMail\MyArchiveFolder”

/DA

The destination archive. Specify the name of a PST as it appears in the “Destination” dropdown list of the OTA screen. E.g. /DA:”My Archive”

/DF

The destination folder when exporting to a disk folder. E.g./DF:”C:\My Documents\Exported Mail”

/AP

The archive period. This can be specified in two ways: To archive items up to a date relative to the current date, specify a number followed by d, m, w or y. For example /AP:7d would archive all items dated up to 7 days ago. And /AP:6m would archive all items dated before the 1st of the month six months previous. /AP:2y would archive all items dated before the current date 2 years ago.

To specify an absolute date range use the format /AP:yyyymmdd-yyyymmddA. For example: /AP:19981105-20140611A would archive all items between the 5th November 1998 and the 11th June 2014.

Make sure to include the A after the second date!

/UR

Include unread messages or not. Use /UR:Y for Yes, /UR:N for No

/FS

Mail subject. E.g. /FS:”*invoices 2014*”

/FF

“From” email address. e.g. /FF:”*@outlooktruearchive.com”

/FT

“To” email address. e.g. /FT:”first.last@mydomain.com”

/SEL

The selection file which specifies the folders which are not to be processed. If you do not specify a selection file, all folders will be processed.

Please note: The folder list inside the selection file is an exclusion list. Therefore any folder not listed in the SEL file will be included in the task operation.

This is especially important to note when performing a Delete task in OTA.

/FO

Specifies folders to include in the task operation – all other folders will be ignored. Format is /FO:”[FolderName]” To specify multiple folders, separate each folder name with a comma e.g. /FO:“Inbox,TestFolder,Tasks“

To include subfolders the complete path to the folder should be specified, e.g.:

Examples:

This performs an Archive task, moving mail older than 6 months from the “Personal Folders” PST to the “My Archive” PST, including unread mails. The folders.sel file determines which folders are actually processed.

/Auto /T:C /AP:1y /SA:”Personal Folders” /DF:”C:\temp” /UR:Y /EXF:MSG

This exports a copy of mail older than 1 year to the folder C:\Temp, including unread mails. The messages will be exported in MSG format. Filenames will be based on the creation time and subject of each message. All folders in the source PST are processed.

Environment variables may be used with the SA, SF, DA and DF switches. For example, a source mailbox could be defined by /SA:”Mailbox – %username%” where username is defined as the current user’s name.