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