Like most apps, you can launch Word from the Command Prompt, but Word also supports several optional switches for controlling the startup process.

Whether you type the command at the prompt, use it to create a shortcut, insert it as part of a batch script, launching Word with additional parameters lets you do things like start Word in Safe Mode for troubleshooting or start with a specific template.

Using the Command Prompt to Start Word

Before we can open Word using the Command Prompt, we need to figure out which directory the winword.exe file is located. You can do this manually, or you can just have the Command Prompt find it for you. To do this, go ahead and open the Command Prompt by opening the start menu and typing “cmd” and selecting the “Command Prompt” application.

When you open the Command Prompt, you’ll be in the top tier directory—your user account folder. We need to dig deeper by going into the Program Files directory. Do so by entering the following command and then pressing Enter:

cd\”program files (x86)”

You’ll now be in the Program Files directory. The next step is to locate the directory where the winword.exe file is located. Do so by typing the following command and pressing “Enter.”

dir winword.exe /s

Once you enter this command, the Command Prompt will locate the directory for you.

Now that you know the directory where the winword.exe file is located, you can use the cd command to open the file path. In this example, you would need to enter the following command:

cd Microsoft Office\root\Office16

Now you should be in the directory where winword.exe is located.

Now, if you want to open Microsoft Word the same way as if you were opening it via its icon, all you must do is type winword and then press “Enter,” and Word will open its usual way.

However, the whole point of using the command is that you can use the different switches and parameters it offers.

Common Word Command Line Switches and Parameters

Borrowed from the official Microsoft Office support site, here is a list of some possible ways to open Word, along with its respective command.

That’s all there is to it! Now you should be able to open Word in any specific way you choose by simply following these commands.

 

/tc:\example.docx

 

Note: Do not put a space between the switch and the name of the file.

Example: To start Word and open the existing file example.docx, stored on the C drive, enter the following:

 

/t c:\example.docx

To open multiple files, example.docx and example2.docx, located in the C drive at once, enter the following:

 

/t c:\example.docx c:\example2.docx

 

/f “c:\Documents and Settings\All Users\Desktop\example.docx

Example: To start Word and open a copy of a file example.docx, stored in a document library at the URL http://MySite/Documents, enter the following:

 

/h http://MySite/Documents/example.docx

 

Note: If the document is checked out to you, the /h switch has no effect. Word opens the files so that you can edit it.

Example: To start and apply the XSLT MyTransform, stored on the C drive, enter the following:

 

/pc:\MyTransform.xsl c:\Data.sml

Example: To start Word and load the add-in Sales.dll, stored on the C drive, enter the following:

 

/ic:\Sales.dll

 

Note: Do not include a space between the switch and the add-in name.

Example: To start Word and then run the macro Salelead, enter the following:

 

/mSalelead

 

Note: Do not include a space between the switch and the macro name.

RELATED: How to Run Command Prompt Commands from a Windows Shortcut