You can control how Outlook starts by using command line switches. While many of the switches are used only when you are having problems with Outlook, including /cleanviews and /cleanreminders, several allow you to do things in Outlook from a command line, such as open a custom form using the /c switch:
outlook.exe /c ipm.contact.familyaddresses
Or open a new Outlook window to a specific folder:
outlook /select outlook:calendar
Many of the switches on this page will work in all versions of Outlook. Most of these switches will work with Outlook 2007 or 2010.
One of my favorite tricks is creating shortcuts for new messages preaddressed to specific people that I frequently send messages to. The shortcut's command line accepts the email address, alias or resolvable name and looks like this:
OUTLOOK.EXE /c ipm.note /m someone@slipstick.com;mary
You can create a Quick Launch or Desktop shortcut that opens a custom form, such as a While you were out phone message form, by replacing ipm.note with the published form name (i.e. ipm.note.wywo). (WYWO sample forms are available at Microsoft Sample Applications)
How to use Command line switches
If you're new to command line switches, open the Run command by pressing Windows key + R, then type the application name (outlook, in this case), a space, then the switch. In most cases, you only need "outlook", but outlook.exe or the full path to outlook.exe will also work.
Outlook /switch
Replace "switch" with the actual switch you want to use. Then press Enter or click OK to start Outlook.
Occasionally you'll need to use the full path to Outlook, in which case, the command line will look like the following. If the path contains spaces you'll need to use parenthesis.
"C:\Program Files\Microsoft Office\Office15\Outlook.exe" /switch
You'll need to use the full file path if you are creating desktop shortcuts. The default location for the "click to run" versions most of us have and when Outlook and Windows are both either 32-bit or 64-bit is
C:\Program Files\Microsoft Office 15\root\office15\outlook.exe
If you are using 32-bit Office on 64-bit windows, the Office applications are in the x86 path:
C:\Program Files (x86)\Microsoft Office 15\root\office15\outlook.exe
Corporate users with volume licenses will find the Office applications in one of these paths:
C:\Program Files\Microsoft Office\office15\outlook.exe
C:\Program Files (x86)\Microsoft Office\office15\outlook.exe
Outlook 2013 Command Lines
Switch | Description |
---|---|
/a c:\filename | Creates an item with the specified file as an attachment. Usage: Outlook /a "C:My Documents\labels.doc" If no item type is specified, IPM.Note form is assumed. This switch cannot be used with message classes that aren’t based on Outlook forms |
/altvba otmfilename | Opens the VBA files specified in otmfilename, rather than %appdata%\Microsoft\Outlook\VbaProject.OTM Use this switch when you need to run macros not in your default VBAProject file. This switch is not supported in Outlook 2013 by default; you need to create a registry value to enable it. HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\15.0\Outlook\Security DWORD: EnableAltVba Data Value of 1 to enable the switch. |
/c messageclass | Creates a new item of the specified message class, works for any valid MAPI form. Examples: /c ipm.activity creates a Journal entry /c ipm.appointment creates an Appointment /c ipm.contact creates a Contact /c ipm.note creates an E-mail message /c ipm.stickynote creates a Note /c ipm.task creates a Task |
/checkclient | Prompts for the default manager of e-mail, calendar, and contacts. |
/cleanautocompletecache | Removes all names and e-mail addresses from the AutoComplete list. |
/cleancategories | Deletes any custom category names that you have created. Restores categories to the default names. |
/cleanclientrules | Starts Outlook and deletes client-based rules. Used by non-Exchange account users. |
/cleanconvongoingactions | Deletes the Conversations Actions Table (CAT). CAT entries for a conversation thread usually expire 30 days after no activity. The command-line switch clears all conversation tagging, ignore, and moving rules immediately stopping any additional actions. |
/cleandmrecords | Deletes the logging records saved when a manager or a delegate declines a meeting. |
/cleanfinders | Removes Search Folders from the Microsoft Exchange server store. |
/cleanfromaddress | Removes all addresses / accounts manually added to the From field. |
/cleanmailtipcache | Removes all MailTips from the cache. |
/cleanreminders | Clears and regenerates reminders. |
/cleanroamedprefs | All roamed preferences are deleted and copied from the local settings on the computer where this switch is used. Included are roaming settings for reminders, free/busy grid, working hours, calendar publishing, and RSS rules. |
/cleanrules | Starts Outlook and deletes client- and server-based rules. |
/cleanserverrules | Starts Outlook and deletes server-based rules. Used only with Exchange server accounts. |
/cleansharing | Removes all RSS, Internet Calendar, and SharePoint subscriptions from Account Settings. This does not delete content previously downloaded to your computer, it only removes the subscription. |
/cleansniff | Reset the sniffer lock, which processes incoming meeting requests and voting messages. |
/cleansubscriptions | Deletes the subscription messages and properties for subscription features. Used with SharePoint alerts |
/cleanweather | Removes all city locations from the Weather Bar. |
/cleanviews | Restores default views. Use with care as all custom views you created are lost |
/embedding msgfilename | Opens the specified message file (.msg) as an OLE embedding. Also used without command-line parameters for standard OLE co-create. |
/f msgfilename | Opens the specified message file (.msg) |
/finder | Opens the Advanced Find dialog box. |
/hol holfilename.hol | Opens the specified Holiday .hol file. |
/ical icsfilename.ics | Opens the specified iCalendar .ics file. |
/importNK2 | Imports the contents of an .nk2 file used by older versions of Outlook, which contains the "nickname" list that is used by the Auto-Complete features. |
/importprf c:\filename.prf | Launches Outlook and opens/imports the defined MAPI profile (*.prf). If Outlook is already open, queues the profile to be imported on the next clean launch. |
/launchtraininghelp assetid | Opens a Help window with the Help topic specified in assetid. |
/m emailname | Provides a way for the user to add an e-mail name to the item. Use either the full address or the alias. Only works in conjunction with the /c command-line parameter. Usage: Outlook.exe /c ipm.note /m test@slipstick.com Outlook.exe /c ipm.note /m dianep |
/nopreview | Starts Outlook with the Reading Pane off and removes the option from the View menu. |
/p msgfilename | Prints the specified message (.msg). |
/profile profilename | Loads the specified profile. If your profile name contains a space, enclose the profile name in quotation marks: outlook.exe /profile "diane poremsky" |
/profiles | Opens the Choose Profile dialog box regardless of the Options setting on the Tools menu. |
/promptimportprf | Same as /importprf except that a prompt appears, allowing the user to cancel the import. |
/recycle | Starts Outlook using an existing Outlook window, if one exists. |
/remigratecategories | Starts Outlook and upgrades colored For Follow Up flags to Office Outlook 2007 color categories, calendar labels to Office Outlook 2007 color categories. Also adds all categories used on non-mail items into the Master Category List. Note: This is the same as Upgrade to Color Categories command. |
/resetfoldernames | Resets default folder names (such as Inbox or Sent Items) to default names in the current Office user interface language. For example, if you connect to your mailbox Outlook using a Russian user interface, the default folder names are in Russian and cannot be renamed. After changing the user interface language or installing a different language version of Outlook, you can use this switch to reset the default folder names. |
/resetfolders | Restores missing folders for the default delivery location. |
/resetformregions | Empties the form regions cache and reloads the form region definitions from the Windows registry. |
/resetnavpane | Clears and regenerates the Navigation Pane for the current profile. Removes all Shortcuts and Favorite Folders. Has the same effect as deleting profilename.xml in your user directory. |
/resetquicksteps | Restores the default Quick Steps. All user-created Quick Steps are deleted. |
/resetsearchcriteria | Resets all Instant Search criteria so that the default set of criteria is shown in each module. |
/resetsharedfolders | Removes all shared folders from the Navigation Pane. |
/restore | Attempts to open the same profile and folders that were open prior to an abnormal Outlook shutdown. |
/rpcdiag | Opens Outlook and displays the remote procedure call (RPC) connection status dialog. |
/rununittests | |
/safe | Starts Outlook without extensions, Reading Pane, or toolbar customization. Same as holding Ctrl while clicking the Outlook shortcut. |
/safe:1 | Starts Outlook with the Reading Pane off. |
/safe:3 | Starts Outlook with extensions turned off, but listed in the Add-In Manager. |
/select foldername | Starts Outlook and opens the specified folder in a new window. Usage: "C:\Program Files\Microsoft Office\Office15\Outlook.exe" /select outlook:calendar outlook /select "outlook:Inbox\Old Messages" |
/share //URL | Specifies a sharing URL to connect to Outlook. For example, use stssync://URL to connect a Microsoft Windows SharePoint Services list to Outlook. Examples: /share feed://URL/filename /share stssync://URL/filename /share web://URL/files |
/sniff | Starts Outlook and forces a detection of new meeting requests in the Inbox, and then adds them to the calendar. |
/t oftfilename | Opens the specified .oft (template) file. |
/v vcffilename | Opens the specified .vcf file. |
/vcal vcsfilename | Opens the specified .vcs file. |
More Information
For a list of switches available in older versions of Outlook, see How to use Outlook’s Command Line Switches
For a video tutorial, see Command Line Switches Tutorial
"outlook /select outlook:calendar" does not work for me in my logon startup script for Outlook 365 anymore. Instead, it just starts Outlook 365 in it's default folder, the Inbox. I know I can tell Outlook to open with my Calendar, but if I did that and then opened another Outlook instance for my Inbox, my WindowManager would see another Calendar instance and lock it on top of my existing Calendar instance. It used to work, but I've been foiled by yet another wonderful Office 365 Update !
Disclaimer: I'm a Linux/OSX aficionado and I loathe Microsoft, but my employer won't give me the option to use a Superior OS, so I'm stuck with B.S. like this.
I am creating a batch file to simplify the startup of 8 programs which we start on windows 10. Most work with; start "path/program". However, when we try this for the outlook email client, office 16 (part of 365 pro) just launches another terminal window when I try to open the outlook client this way. Is the outlook client smart enough to be launched from a batch file or do we need to find a better client?
Here is the exact line I am trying to use.
start "C:\Program Files\Microsoft Office\Office16\OUTLOOK.EXE"
Any ideas?
What about the /pim switch, i.e. "outlook.exe /pim DummyProfile"? This is used to create a "dummy" profile (i.e. no mail account attached) so you can run AutoDiscover diagnostics. I noticed this is also not listed in the MS KB article about these switches, but appears elsewhere. Not sure if it is is 2016/365 specific, but I get an error if I try it on Outlook 2013 (MSI).
That is for 2016 and newer builds - they removed the ability to create a new mail profile and added the switch to replace it.
https://www.slipstick.com/outlook/create-no-mail-account-outlook-2016/
Hi,
With regards to /select foldername
Do you know if it's possible to specify a dynamic folder, such as one under "Search Folders"?
Thanks in advance
Toff
Yes, use this format: /select "outlook:\\alias@domain.com\search folders\unread mail"
That command is for a folder in a secondary data file - try this for the default data file /select "outlook:\\search folders\unread mail"
https://www.slipstick.com/outlook/choose-outlook-startup-folder/
Hi Diane,
I want to consult you for this problem in Outlook 2013 :
When my user searches for a "sender" on her inbox: the result displays emails from most recent to oldest (chronological), but when she classifies them by "From" to display the name of this sender: it only sees the mails of August and April, because those of May, June and July are displayed at the bottom: the months are not displayed in chronological order
This anomaly also manifests itself with the search for other shippers.
I don't find any solution on Internet for this problem
Thank you very much
Hi Diane,
I have a little question to consult you :-)
It's about the deployment of a password-protected "VbaProject.OTM" to Outlook 2010 or above version.
Actually, In the past time when I used Outlook 2007, I just need to copy the "VbaProject.OTM" to the path "%AppData%MicrosoftOutlookVbaProject.OTM". If the macro is enabled in Outlook Options, when I restart Outlook, the macro will be loaded automatically.
But recently after I upgraded Outlook to version 2010, I found that if I just copy the OTM file to that path, the macro will never be loaded automatically, unless I open the VBA project once with correct password then restart Outlook. But you know it is not a good solution to deploy the macro for tens of desktops.
So I want to know if there is any better way to solve the problem, or maybe I could do something else to make the deployment easier.
Thank you very much :-)
the easiest way to deploy to compile into a com addin and install it. For security reasons, macros won't run if the editor isn't initialized.
Not putting it in the default location might work - but that needs opened with a command line, which is just as hard to deploy.
https://www.slipstick.com/developer/start-outlook-vba-project-file/
Hi!
How can I use the "/a {filepath}" to attach multiple files? this switch seems to only work to attach one file per email message created...
Correct, that only works with one file. Use Joe's script at https://www.slipstick.com/outlook/create-a-custom-send-to-shortcut/ (at end of article) to insert multiple attachments.
Hi Diane,
I have a SharePoint List that can't be removed from Outlook 2013. After deleting it, it just comes back when Outlook is restarted.
I was excited to discover the command line switches cleansubscriptions and cleansharing. They seem to be meant for my exact situation. But they do nothing. The list still comes back.
The commonly suggested solution (Check the box that says "Don't display this list on other computers I use") is useless because that check box does not exist. Also, I know the problem is local to this machine because it still happens when I disconnect it from the network.
Do you have any other suggestions?
Is this the last/only sharepoint list? If so, delete the sharepoint data file in %localappdata%\microsoft\outlook. If that doesn't work, you might need MFCMAPI to examine your mailbox and delete whatever hidden file is hanging around.
Thanks for your help Diane. It was the last Sharepoint list but deleting the data file had no effect. It just came back. Tried MFCMAPI for the first time ever. Dug through data folders for quite a while but never found anything identifiable. Seemed like I was just looking at an exe in a hex editor. I put it off for as long as possible with hope of finding a specific solution, but in the end I just created a new profile and that finally killed the cursed Sharepoint list.