For reliable results in your archive

Command Line Switches

Outlook True Archive – Command Line Switches

Available as a PDF file – click here. (<200kb)

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.:
/FO:"Inbox,Sent Items,MyFolder\TestSubFolder1, MyFolder\TestSubfolder2"
/EXF Export format when exporting mail to disk. Valid values are MSG, EML, HTML, EHTML, TNEF, TEXT. Default format is MSG
/EXP Naming   pattern for export files. Enclose value in quotes. Default is”%ct% – %su%”. Please note: when using this switch in a batch file you must use double percentage signs e.g. “%%ct%% –   %%su%%” or tilde e.g. “~ct~ – ~su~”
/DM Delete Mode. Use D for Delete, M for move to Deleted Items folder, E for permanent delete in Exchange. No warning will be given prior to execution of the delete!
/Preview Preview the task.
/TI Specifies the title of the popup which opens during an automated task. Format is /TI:”<Task Title>”
/FFS Enables filtering dependant on the colour of the Follow Up flag assigned to an Outlook item. Options are:
/FFS:CP Items marked Complete
/FFS:NC No colour flag set
/FFS:NF No flags set
/FFS:RED Red flag
/FFS:BLU Blue flag
/FFS:GRN Green flag
/FFS:ORG Orange flag
/FFS:PUR Purple flag
/FFS:YEL Yellow flag
/PFN Specifies which Outlook email profile to use when performing an automated task.  If the switch is not used OTA performs the task on the default Outlook email profile.  Format is /PFN:”ProfileName”
/PFP Specifies the password to access the profile specified by the PFN switch.  If no password is assigned to the profile this switch is not required.


/Auto /T:A /AP:6m /SA:”Personal Folders”   /DA:”My Archive” /UR:Y /SEL:”C:\Folders.SEL”
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.