How to open Microsoft Word document from the command line

Updated: 06/09/2020 by Computer Hope
Microsoft Word

It's not possible to open Microsoft Word in a command line, but it is possible to start Microsoft Word from the command line by following the steps below.

Note

Microsoft Word is a Windows program and cannot display a Word document in the Windows command line window. If you need a document to be viewed in the command line window, we suggest saving the document as a text file.

Opening document from the command line

  1. Open the Windows command line.
  2. Use the cd command to change to the directory containing the Microsoft Word document.
  3. Once in the directory containing the document, use the start command to open the document in Windows. For example, if the document is called "example.doc," type the following command.
start example.doc

Once the command above is run, if the file "example.doc" exists in the current directory, it opens Microsoft Word and then displays the document.

Tip

Using the start command in a batch file is a way of opening a document for the user to read after an install.

Opening Microsoft Word from the command line

To open Microsoft Word by itself without opening a document, first determine where the directory containing winword.exe is located by following the steps below.

  1. Open the Windows command line.
  2. Type the following command to change to the "Program Files (x86)" directory.
cd "\Program Files (x86)"
  1. From the C:\Program Files (x86) directory, type the command below to find the directory containing the winword.exe file.
dir winword.exe /s
  1. After the command above is typed, the computer searches for the file and a few seconds later it should list the directory containing "winword.exe." For example, it may give a directory similar to the example output shown below.
Directory of C:\Program Files (x86)\Microsoft Office\Office14
  1. Once you know the directory, navigate to the directory using the cd command and the name of the directory. For example, to get to the path above from the Program Files (x86) directory, type the following command.
cd Microsoft Office\Office14
  1. Once the prompt shows the proper directory, type winword to open Microsoft Word in Windows from the command line.