قالب وردپرس درنا توس
Home / Tips and Tricks / How (and Why) to start Microsoft Word from the Command Prompt

How (and Why) to start Microsoft Word from the Command Prompt



 Word logo

Like most apps, you can start 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 Using the Command Prompt to Start Word

Before. (1

965) 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 to find it for you. [Cmd] and selecting the "Command Prompt" application.

 Open Command Prompt in Start Menu

When you open the Command Prompt, you'll be in the top tier directory-your user account folder. We need to dig deeper into the Program Files directory. Enter:

cd "program files (x86)"

 Program Files in Command Prompt

You'll now be in the Program Files directory. The next step is to locate the directory where the winword.exe file is located.

You winword.exe / s

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

 Winword directory

Now that you know the directory where the winword.exe file is located, you can use the 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.

 Open Winword file

Now winword and then press "Enter," and Word will open its usual way. 19659003]  Open Normal Word

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

Common Word Command Line Switches and Parameters

Switch and Parameters Description / safe Starts Word in Safe Mode. This launches Word without any additional add-ins, templates, and other customizations. It's helpful when troubleshooting problems in Word.

You can also launch Word in Safe Mode by launching the Ctrl key while launching Word from the Start menu, creating a shortcut with this parameter makes it much easier.

/ q Starts Word without displaying the Word Splash screen. / ttemplatename Starts Word with a new document based on a template other than the Normal template.

Example: Assume we wanted to open a document stored on the C drive called example.docx, we'd type the following command:

/tc:example.docx [

Note:

/ t filename Starts Word and opens an existing file.

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

/ tc: example .docx

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

/ tc : example.docx c: example2.docx

/ f filename Starts Word with a new document based on an existing file.

Example: To start Word and create a new document based on file example.docx, stored on the desktop, enter the following:

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

/ h http: // filename Starts Word and opens a read-only copy of a Microsoft Windows SharePoint Services site. Word 2007 or later Windows Windows SharePoint Services 2.0 or later.

Example: To start Word and open a copy of a file example.docx, store in a document library at the URL http: //sisite/documents, enter the following: [19659003]

/ 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.

/ pxslt Starts Word and opens an existing XML document based on the specified XSLT.

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

/pc:MyTransform.xsl c: Data.sml

/ a Starts Word and prevents add-ins and global templates from being loaded automatically. The / a switch also locks the settings files. / ladd-in Starts Word and then loads a specific Word add-in.

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

/ ic: Sales.dll

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

/ m launches Word without running any AutoExec macros. / mmacroname Starts Word and the runs a specific macro. The m / switch prevents words from running any AutoExec macros.

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

/ mSalelead

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

/ n Starts a new instance of Word with no document open. Windows opens a list of other instances. / w Starts a new instance of Word with a blank document. / r Re-registering Word in the Windows registry. This switch starts Word, runs Office Setup, updates the Windows registry, and the closes. / x Word starts from the operating system shell so that Word responds to only one DDE request (for example, to print a document programmatically). / ztemplatename Visibly behaves exactly like the / t switch. However, you can use the / c switch with Word to generate both a Startup and a New event, whereas the / t switch generates only a Startup event.

That's all there is to it!

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


Source link