Starting Microsoft Word from the Command Prompt (and Why)
You can launch Microsoft Word from the Command Prompt and use various switches to control how it starts. This is useful for troubleshooting, automating tasks, or starting Word with specific configurations.
Opening Word Using the Command Prompt
- Find the Location of
winword.exe
:- Open the Command Prompt by typing “cmd” in the Start menu and selecting Command Prompt.
- Change the directory to the Program Files folder by typing:bashCopy code
cd\”program files (x86)”
This takes you to the Program Files directory. - To locate
winword.exe
, type:bashCopy codedir winword.exe /s
- Once located, navigate to the folder containing
winword.exe
(e.g.,Microsoft Office\root\Office16
) by typing:bashCopy codecd Microsoft Office\root\Office16
- Launch Word:
- To open Word normally, type:bashCopy code
winword
- To open Word normally, type:bashCopy code
Common Word Command Line Switches
Here’s a list of switches you can use to launch Word in specific ways:
Switch | Description |
---|---|
/safe | Starts Word in Safe Mode (no add-ins, templates, or customizations). Useful for troubleshooting. |
/q | Starts Word without displaying the splash screen. |
/t template_name | Starts Word with a new document based on a specific template. |
/t filename | Starts Word and opens an existing file. Example: /t c:\example.docx |
/f filename | Starts Word with a new document based on an existing file. |
/h URL | Opens a read-only copy of a document stored on a SharePoint server. |
/pxslt | Starts Word and applies an XSLT to open an XML document. |
/a | Starts Word and prevents add-ins and global templates from being loaded. |
/l add-in | Starts Word and loads a specific add-in. Example: /l c:\Sales.dll |
/m | Starts Word without running any AutoExec macros. |
/m macro_name | Starts Word and runs a specific macro. Example: /m Salelead |
/n | Starts a new instance of Word with no document open. |
/w | Starts a new instance of Word with a blank document. |
/r | Re-registers Word in the Windows registry. |
/x | Starts Word from the operating system shell to respond to a DDE request (e.g., printing). |
/z template_name | Similar to /t , but also triggers both Startup and New events. |
Using Command Line Switches in Shortcuts or Scripts
To make using these switches easier, you can create shortcuts or batch scripts with the desired commands. For example, to open Word in Safe Mode via a shortcut, you would create a shortcut with the following target:
bashCopy code"C:\Program Files (x86)\Microsoft Office\root\Office16\winword.exe" /safe
This approach allows for quick access to specific versions of Word, tailored to your needs.