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
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:
"C:\Program Files\Microsoft Office\root\Office16\​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, you can either use the Start menu, Run command (Windows key + R) or click in the Search box in the taskbar (or click on the Start menu, if you aren't showing the search field) and 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 also work. Tip: if you are using a switch you'll use again, use the Run command as it will add it to the most recently used list. You'll be able to select it from the list instead of retyping it.
Outlook /switch
Replacing "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\root\Office16\​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 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
You'll need to use the full file path if you are creating desktop shortcuts.
For a video tutorial, see Command Line Switches Tutorial
Popular and Useful Switches
These switches work in all versions of Outlook.
Switch | Description |
---|---|
/Safe | Opens Outlook in Safe mode (Alternately, you can hold Ctrl as you click on the Outlook icon to start in Safe mode.) |
/cleanviews | Resets the views to Outlook's default views. Note: this will delete all custom views you may be using. |
/resetnavpane | Use when Outlook won't open. This resets Outlook's navigation pane to the default settings. Error Message: Cannot start Microsoft Office Outlook |
/select foldername | Starts Outlook and opens the specified folder in a new window. Usage: "C:\​Program Files\​Microsoft Office\​Office12\​Outlook.exe" /select outlook:calendar outlook /select "outlook:Inbox\​Old Messages" |
/profile profilename | Create a shortcut using this switch when you have multiple profiles to load the specified profile. If your profile name contains a space, enclose the profile name in quotation marks. |
/cleanreminders | Use when dismissed reminders keep coming back. Delete reminders that keep returning |
/resettodobar | Deletes and recreates the To-Do Bar task list for the current profile. The To-Do Bar search folder is also deleted and re-created. Outlook 2007 and Outlook 2010 only. Error with the To-Do Bar's Task list |
All Command Line switches
This table lists all of the switches available for Outlook 2007, 2010, 2013, 2016, 2019, and 365.
Switch | Description | Supported Version |
---|---|---|
/a c:\pathto\filename | Creates an item with the specified file as an attachment. Usage: Outlook /a "D:\​Documents\​labels.docx" 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 | 2007, 2010, 2013, 2016, 2019, 365 |
/altvba otmfilename | Opens the VBA program specified in otmfilename, rather than %appdata%\​Microsoft\​Outlook\​VbaProject.OTMUse this switch when you need to run macros not in your VBAProject file.Not supported in Outlook 2010 by default. You can create a registry value to enable it. HKEY_CURRENT_USER\​Software\​Policies\​Microsoft\​Office\​14.0\​Outlook\​Security DWORD: EnableAltVba Data Value of 1 to enable the switch | 2007, 2010, 2013, 2016, 2019, 365 |
/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 | 2007, 2010, 2013, 2016, 2019, 365 |
/checkclient | Prompts for the default manager of email, calendar, and contacts. | 2007, 2010, 2013, 2016, 2019, 365 |
/cleanautocompletecache | Removes all names and email addresses from the AutoComplete list. | 2010, 2013, 2016, 2019, 365 |
/cleancategories | Deletes any custom category names that you have created. Restores categories to the default names. | 2007, 2010, 2013, 2016, 2019, 365 |
/cleanclientrules | Starts Outlook and deletes client-based rules. | 2007, 2010, 2013, 2016, 2019, 365 |
/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. | 2010, 2013, 2016, 2019, 365 |
/cleandmrecords | Deletes the logging records saved when a manager or a delegate declines a meeting. | 2007, 2010, 2013, 2016, 2019, 365 |
/cleanfinders | Removes Search Folders from the Microsoft Exchange server store. | 2007, 2010, 2013, 2016, 2019, 365 |
/cleanfreebusy | Clears and regenerates free/busy information. This switch can only be used when you are able to connect to your Microsoft Exchange server. | 2007, 2010 |
/cleanfromaddress | Removes all addresses / accounts manually added to the From field. | 2010, 2013, 2016, 2019, 365 |
/cleanips | Restores receiving new messages in Exchange Cached mode For more information, see When Outlook 2007 is running in Cached mode, users do not see some new e-mail messages (MSKB 968773) | 2007, 2010, 2013, 2016, 2019, 365 |
/cleanmailtipcache | Removes all MailTips from the cache. | 2010, 2013, 2016, 2019, 365 |
/cleanprofile | Removes invalid profile keys and recreates default registry keys where applicable. | 2007 |
/cleanreminders | Clears and regenerates reminders. | 2007, 2010, 2013, 2016, 2019, 365 |
/cleanroamedprefs | All previous roamed preferences are deleted and copied again from the local settings on the computer where this switch is used. This includes the roaming settings for reminders, free/busy grid, working hours, calendar publishing, and RSS rules. | 2007, 2010, 2013, 2016, 2019, 365 |
/cleanrules | Starts Outlook and deletes client- and server-based rules. | 2007, 2010, 2013, 2016, 2019, 365 |
/cleanserverrules | Starts Outlook and deletes server-based rules. | 2007, 2010, 2013, 2016, 2019, 365 |
/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. | 2010, 2013, 2016, 2019, 365 |
/cleansniff | This forces Outlook to reset the Sniffer Lock value to the computer on which the switch is used. The Sniffer Lock determines which of your computers processes the meeting items when you run Outlook on multiple computers a the same time. The lockout process helps prevent duplicate reminder messages. | 2007, 2010, 2013, 2016, 2019, 365 |
/cleansubscriptions | Deletes the subscription messages and properties for subscription features. Used with SharePoint alerts | 2007, 2010, 2013, 2016, 2019, 365 |
/cleanweather | Removes city locations added to the Weather Bar. | 2013, 2016, 2019, 365 |
/cleanviews | Restores default views. Use with care as all custom views you created are lost | 2007, 2010, 2013, 2016, 2019, 365 |
/embedding msgfilename | Opens the specified message file (.msg) as an OLE embedding. Also used without command-line parameters for standard OLE co-create. | 2007, 2010, 2013, 2016, 2019, 365 |
/explorer | Opens the new window in “explorer” mode (link bar on). | 2007 |
/f msgfilename | Opens the specified message file (.msg). | 2007, 2010, 2013, 2016, 2019, 365 |
/finder | Opens the Advanced Find dialog box. | 2007, 2010, 2013, 2016, 2019, 365 |
/firstrun | Starts Outlook as if it were run for the first time. | 2007 |
/folder | Opens a new window in “folder” mode (Navigation Pane off). | 2007 |
/hol holfilename.hol | Opens the specified .hol file. | 2007, 2010, 2013, 2016, 2019, 365 |
/ical icsfilename | Opens the specified .ics file. | 2007, 2010, 2013, 2016, 2019, 365 |
/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. | 2010, 2013, 2016, 2019, 365 |
/importprf c:\pathto\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. | 2007, 2010, 2013, 2016, 2019, 365 |
/launchtraininghelp assetid | Opens a Help window with the Help topic specified in assetid. | 2007, 2010, 2013, 2016, 2019, 365 |
/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 | 2007, 2010, 2013, 2016, 2019, 365 |
/manageprofiles | Opens the Mail Setup dialog to manage your Mail Profile and account settings outside of Outlook. | 2016, 2019, 365 (New as of Build 1806) |
/nocustomize | Starts Outlook without loading outcmd.dat (customized toolbars) and *.fav file. | 2007 |
/noextensions | Starts Outlook with extensions turned off, but listed in the Add-In Manager. | 2007 |
/nopreview | Starts Outlook with the Reading Pane off and removes the option from the View menu. | 2007, 2010, 2013, 2016, 2019, 365 |
/p msgfilename | Prints the specified message (.msg). | 2007, 2010, 2013, 2016, 2019, 365 |
/pim profilename | Creates a new Mail Profile with the specified name but without an email account. | 2016, 2019, 365 |
/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" | 2007, 2010, 2013, 2016, 2019, 365 |
/profiles | Opens the Choose Profile dialog box regardless of the Options setting on the Tools menu. | 2007, 2010, 2013, 2016, 2019, 365 |
/promptimportprf C:\pathto\filename.prf | Same as /importprf except a prompt appears and the user can cancel the import. | 2007, 2010, 2013, 2016, 2019, 365 |
/recycle | Starts Outlook using an existing Outlook window, if one exists. Used in combination with /explorer or /folder. | 2007, 2010, 2013, 2016, 2019, 365 |
/remigratecategories | Starts Outlook and upgrades colored For Follow Up flags to Outlook 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. | 2007, 2010, 2013, 2016, 2019, 365 |
/remigrateconversations | 2010, 2013, 2016, 2019, 365 | |
/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. | 2007, 2010, 2013, 2016, 2019, 365 |
/resetfolders | Restores missing folders for the default delivery location. | 2007, 2010, 2013, 2016, 2019, 365 |
/resetformregions | Empties the form regions cache and reloads the form region definitions from the Windows registry. | 2007, 2010, 2013, 2016, 2019, 365 |
/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. | 2007, 2010, 2013, 2016, 2019, 365 |
/resetquicksteps | Restores the default Quick Steps. All user-created Quick Steps are deleted. | 2010, 2013, 2016 |
/resetsearchcriteria | Resets all Instant Search criteria so that the default set of criteria is shown in each module. | 2007, 2010, 2013, 2016, 2019, 365 |
/resetsharedfolders | Removes all shared folders from the Navigation Pane. | 2007, 2010, 2013, 2016, 2019, 365 |
/resettodobar | Clears and regenerates the To-Do Bar task list for the current profile. The To-Do Bar search folder is deleted and re-created. | 2007, 2010, 2013, 2016, 2019, 365 |
/restore | Attempts to open the same profile and folders that were open prior to an abnormal Outlook shutdown. | 2010, 2013, 2016, 2019, 365 |
/rpcdiag | Opens Outlook and displays the remote procedure call (RPC) connection status dialog. | 2007, 2010, 2013, 2016, 2019, 365 |
/rununittests | 2013, 2016, 2019, 365 | |
/safe | Starts Outlook without extensions, Reading Pane, or toolbar customization. Same as holding Ctrl while clicking the Outlook shortcut. | 2007, 2010, 2013, 2016, 2019, 365 |
/safe:1 | Starts Outlook with the Reading Pane off. | 2007, 2010, 2013, 2016, 2019, 365 |
/safe:3 | Starts Outlook with extensions turned off, but listed in the Add-In Manager. | 2007, 2010, 2013, 2016, 2019, 365 |
/safe:4 | Starts Outlook without loading Outcmd.dat (customized toolbars) and *.fav file. | 2007 |
/select foldername | Starts Outlook and opens the specified folder in a new window. Usage: "C:\Program Files\Microsoft Office\root\Office16\Outlook.exe" /select outlook:calendar outlook /select "outlook:Inbox\​Old Messages" | 2007, 2010, 2013, 2016, 2019, 365 |
/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 | 2007, 2010, 2013, 2016, 2019, 365 |
/sniff | Starts Outlook and forces a detection of new meeting requests in the Inbox, and then adds them to the calendar. | 2007, 2010, 2013, 2016, 2019, 365 |
/t oftfilename | Opens the specified .oft (template) file. | 2007, 2010, 2013, 2016, 2019, 365 |
/v vcffilename | Opens the specified .vcf file. | 2007, 2010, 2013, 2016, 2019, 365 |
/vcal vcsfilename | Opens the specified .vcs file. | 2007, 2010, 2013, 2016, 2019, 365 |
/x xnkfilename | Opens the specified .xnk file. See .XNK Extension error: "Cannot Open File". | 2007 |
More Information
For a video tutorial, see Command Line Switches Tutorial
while opening the outlook.exe with a new email from command prompt, how to move the .text file content to body of the email?
There is not a way to read the text file into the body using a simple command line - you need to use a script (VBScript will work, or PowerShell) to read the text file and insert it into the body using mailto:.
something like this... which I have not tested. It might not insert the text (inserting the word content instead) and you would need to use the script to open the message then insert the text.
Const ForReading = 1
Dim file, content
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile("C:\test.txt", ForReading)
content = file.ReadAll
mailto:alias@domain?subject=test&cc=test@domain&body=content
Amazing information !
Thanks
I think this is a "switch" issue fixable in the registry--I have Outlook 2010.
When a recent "search" oddly crashed it and it wouldn't reopen even after running the built in scan pst fixer (it got hung on profile) I used the windows repair tool to fix it--Indeed it fixed it except for one bizarre bug I cannot fix myself. Double copies of Outlook!
So I always leave Outlook open. When I'm in any browser and choose "send to" to send a link to my email--what now happens is a brand new iteration of Outlook (i.e. outlook.exe) is opened PLUS an email window. I don't want two iterations of Outlook running, just one. I just want the email window open within the single copy of open Outlook.
Making sense here?
Normally when I click on "send to email" ONLY a new email window (only) opens--not a full iteration of outlook. Clearly Microsoft Office fix "fixed" something that wasn't broken
How can I fix this? thanks!
Either the shortcut was changed - you can make a shortcuts and add /recycle switch to the path. If you are hiding Outlook when minimized, it will open a new copy if you don't open it from the tray.
What I would do first is a quick repair - this will fix shortcuts - and if its still a problem, update the shortcut. Instructions are in this articles:
https://www.slipstick.com/outlook/one-version-outlook-run-time/
https://www.slipstick.com/outlook/start-outlook-minimized-or-minimize-to-tray/
I can't seem to get Outlook to completely open when I use even just one switch. I don't get an error. It just hangs indefinitely. Any ideas why? I'm using Outlook 365 on Windows 10. Thanks for any help. I'm an instructor and I used to love being able to reset the student workstations after the training, but now I can't.
What switch are you using? Although without an error, its impossible to know why its not working. I would set up Outlook (and all of office, if you are also training for all apps) how you want it for new students - no profile, default settings then export the registry key. Import / run the reg file on all the computers to reset.
Hi Diane, thanks for this! I have need to combine switches thus
start outlook /Profile Fred /c ipm.note /m accounts@media.com?subject=New_invoice_to_issue
start outlook /Profile Fred works, but I have to add the address and subject
start outlook /c ipm.note /m accounts@media.com?subject=New_invoice_to_issue works mut I have to pick the profile
How do I get both please
Unfortunately, your can't mix some switches. You should be able to do it in a vba or powershell script.
Hi Diane
I fix it, works like a charm
Bat Script:
start outlook /Profile Fred
timeout 5
start outlook /c ipm.note /m accounts@media.com?subject=New_invoice_to_issue
Anyone know how to open the online archive with a command line switch?
Thanks for this Diane. I was looking for a way to switch profile without having to go into Control Panel > Mail
I have 2 profiles, one for teaching, which I use once every couple weeks and my main one with my day to day mailboxes.
In the late 2000s I recall there was a shortcut <ctrl>-<shift><something> I could press while clicking on outlook that would allow me to select the profile when I launching Outlook. I can't remember that anymore... I'm getting too old....
Cladio do this:
Control Panel
Mail
Show Profiles - Down the bottom activate 'prompt for profile to be used'
cheers
I have a problem where Outlook stalls while searching the server for messages. I've had this before, solution is to lengthen the time that Outlook allows each of my accounts for searching the server. But I need to start Outlook in a different mode to allow me to modify the account(s) in that way, and I don't seem to have the record of how to do this. Can you help me out? (The email below is Exchange, so not affected by the issue)