Outlook Command line Fixes

Cleaning up Outlook

Anyone who’s worked as a system administrator will tell you that certain employees can have a tendency to … adjust their computer station.

Whether they’ve been fiddling with settings that should go untouched or repetitive reminders that clog up the system, cleaning up this mess can be frustrating.

Fortunately, we can use switches to clean up some parts of Outlook without even touching the program. The following command will remove all names and email addresses from the Autocomplete register:

<code>outlook.exe /cleanautocompletecache

There are plenty of other things that we can clean in Outlook by switching out /cleanautocompletecache for another switch:

  • /cleancategories — Deletes any custom category names and restores category names to their default labels.
  • /cleanclientrules — Deletes client-based rules.
  • /cleanserverrules — Deletes server-based rules.
  • /cleanrules — Deletes both client-based and server-based rules.
  • /cleanreminders — Clears and regenerates reminders.
  • /cleanviews — Deletes any custom views and restores the defaults.

Opening and Finding Files

Switches can be used to open individual files in Outlook without having to navigate through an email inbox. The following command will open either a message file using the MSG format or a saved search that uses the OSS format—just swap out file-name.

<code>outlook.exe /f file-name

We can also swap out /f for /hol to open a HOL file, and /ical to open an ICS file.

Sometimes you might not have the file name of the content that you’re looking for. In this situation, you can use the /finder switch:

<code>outlook.exe /finder

This will produce the Advanced Find window, which is a powerful search tool to find just about anything hidden away in Outlook.

Windows 10 Outlook Advanced Find Command Switch

Opening Outlook

Initializing Outlook from a Run command might shave a few seconds off the process, but that’s not the only reason you might want to use it. By taking advantage of switches, you can open Outlook and perform other useful tasks at the same time.

Enter the following into a Run dialog to open up Outlook with the Reading Pane disabled:

<code>outlook.exe /nopreview

You can switch out /nopreview for /safe to disable both the Reading Pane and any active toolbar customizations.

Alternatively, you can initialize Outlook and open a specific folder by using the following command:

<code>outlook.exe /select folder-name

Just replace folder-name with the title of a particular folder or reference like outlook:calendar.

One especially time-saving switch is /sniff. This switch opens Outlook, looks for new meeting requests in the inbox and adds anything it finds to the calendar.

You activate the switch like this:

<code>outlook.exe /sniff

In the event that Outlook crashes, there’s a switch that can attempt to open the same profile and folders that were active before the crash:

<code>outlook.exe /restore

Finally, if you want to initialize Outlook by using an Outlook window that’s already open (if one exists), you can use this command:

<code>outlook.exe /recycle

Where is Cleanfreebusy?

You may notice that among these switches for Outlook 2016 the absence of a very powerful switch:

<code>outlook.exe /cleanfreebusy

Unfortunately, this switch is not available in the 2016 edition of Outlook. Microsoft phased out this feature in the 2010 edition. There is not a direct replacement for this feature yet, perhaps in the future, there will be an alternative.