Microsoft Outlook Tips: Outlook 2007 Switches Using the Command Line

Microsoft Outlook Tips: Outlook 2007 Switches Using the Command Line
Page content

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 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.

This post is part of the series: Microsoft Office Outlook 2007 Tips

A series of Tips and Tricks for working with Microsoft Outlook 2007 both as a user and an administrator.

  1. New E-mail Account Configuration in Microsoft Outlook: Tip #1
  2. Use AutoComplete “Nickname” Cache in Outlook: Tip #2
  3. Configure Outlook Custom Message Views: Tip #3
  4. How to Configure RSS Feeds in Outlook: Tip #4
  5. Tip #5 - Making Changes to the Custom Dictionary in Microsoft Outlook 2007
  6. Tip #6 - Configure Outlook Autosave Settings
  7. Microsoft Outlook Keyboard Shortcuts: Tip #7
  8. Microsoft Outlook 2007 Tip #8 - Outlook.exe Startup Switches
  9. Microsoft Outlook Instant Messenger Addons: #9
  10. Tip #10 - Using Outlook 2007 to Access GMail
  11. Showing Full Message Headers in Microsoft Outlook 2007: Tip #11
  12. How to Re-Send an E-mail Message in Outlook: Tip #12
  13. How to View Animated GIFs Embedded in an E-mail in Microsoft Outlook 2007: Tip #13
  14. Telling Outlook How to Handle Messages: Tip #14
  15. Microsoft Outlook 2007 Tip #15 - How to Color Code the Task List in the To Do Bar
  16. Tip #16 - Importing from Incredimail to Microsoft Outlook 2007
  17. Viewing Multiple Outlook Calendars: Tip #17
  18. Removing Cancelled Future Appointments in Microsoft Outlook 2007: Tip #18
  19. Tip #19: How to Create New Outlook E-mail from the Command Line
  20. How to Configure Outlook AutoArchiving: Tip #20
  21. Using Custom Categories in Microsoft Outlook 2007: Tip #21
  22. How to Manage Outlook Add-ins: Tip #21
  23. Microsoft Outlook 2007 Tip #23 - Attachment Previewing Options