Microsoft Outlook 2007 Tip #8 - Outlook.exe Startup Switches

Written by:  • Edited by: Linda Richter
Updated Mar 12, 2009
• Related Guides: Microsoft | Outlook 2007 | Microsoft Outlook

Microsoft Office Outlook 2007 controls startup behavior through a set of startup switches for outlook.exe. Here are a few Outlook startup switches I use fairly regularly.

How to Run Outlook from the Command Line

Most users will launch Microsoft Outlook 2007 from the default Start menu, desktop or Quick Launch shortcuts. But there are times where Outlook needs to be started with specific settings applied either as a one-time function or a regular routine. There are command line switches for Outlook to perform specific tasks, to clean up settings, and even to incorporate into scripted solutions.

By default, Outlook, as a component of Microsoft Office, is installed in the following location:

c:\Program Files\Microsoft Office\Office12\outlook.exe

Since this path is not included in the Windows Path variable by default, we need the full path to outlook.exe to run it from a command prompt or the run line. The run line is found in the Windows start menu. Either in Start | Run or, as in Vista, Start | All Programs | Accessories | Run. You can also invoke the Run line with the Windows Key and the letter R as a keyboard shortcut. To launch a command prompt, you can run cmd.exe from the run line, or navigate to Start | All Programs | Accessories | Command Prompt.

In either place, we need to either navigate to the folder where outlook.exe resides and launch it from there, or include the full path in the command. We will show the latter. The path has spaces in it, so for Windows to understand those spaces as part of the path, we need to put the whole path in quotes. An example using the /cleanviews switch would look as follows:

c:\>”c:\program files\microsoft office\office12\outlook.exe” /cleanviews

Figures 1 and 2 show the use of this command in the run line and a command prompt respectively.

Screenshots

Figure 1 - Run Outlook from Run LineFigure 2 - Run Outlook from a Command Prompt

Outlook Command-Line Switches

There are numerous command line switches for Outlook 2007. Here are a few that I use fairly regularly, each addressing a specific need:

/cleanviews - This switch resets any customization made in folder views. Sometimes this is easier than trying to change folders back to the default manually.

/nopollmail - Sometimes I need to open Outlook quicky just to check some information. This switch prevents Outlook from checking servers for new mail at startup.

/safe - This is the equivalent of starting Outlook in Safe Mode. It loads Outlook without any extensions or toolbar customization. It also turns off the preview pane. This is good for troubleshooting Outlook issues.

/a “c:\logs\logfile.txt” - This switch creates a new message with a file attachment, in this case, logfile.txt. While Outlook is not the best solution for a command-line mailer, I have used this to script a solution to send log information through Exchange from a client with Outlook installed.

For a complete list of command line switches, go to Microsoft Office Outlook help.


Comments

Showing all 3 comments
 
Dave White Feb 10, 2010 12:50 PM
Shutdown/Close Outlook
In order to send an email via VB, I need to open OUTLOOK - no problem. No help on closing it afterwards
david Oct 8, 2009 2:25 PM
question for William and answer for Rodrigo
William: do you know of a truly exhaustive list of command line switches for Outlook 2007? The list on microsoft.com, which you linked to, doesn't include everything.

Two examples are /cleanips and /nopollmail.

Thanks!

Rodrigo: make sure you include the path to outlook.exe and include it in quotation marks. You should also include the path\filename after /a in quotes, as well:

"c:\path-to-outlook\outlook.exe" /c ipm.note /m rodrigo_allende@ibi.com /a "g:\grupos dinamicos.txt"

I hope that helps.
Rodrigo. Aug 10, 2009 4:45 PM
Outlook m & a switches
When I try to issue outlook.exe with the /m & /a switches, I get the error: "Invalid switch in command line".

Entire string is:
"outlook /c ipm.note /m rodrigo_allende@ibi.com /a G:\grupos dinamicos.txt"

Is this due to any kind of incompatibility between /m and /a ?
Would anybody please help on this?
Thanks and best regards.
 
blog comments powered by Disqus
Email to a friend