Introduction
In this article, we will explore how to use the command line to open Outlook 365. This can be a useful skill to have for a variety of reasons. For example, you may want to create a desktop shortcut that opens Outlook with a specific set of parameters, or you might need to open Outlook from a script or batch file.
The START Command
The START command is a built-in command in Windows that allows you to start a new program or document in a new command window. The syntax for the START command is as follows:
START <drive letter>:<path>For example, to open Outlook 365 from the command line, you would use the following command:
START "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE"Adding Command Line Arguments
You can also pass command line arguments to the START command to customize the way the program starts. For example, you might want to open Outlook with a specific profile or in a particular window size.
To do this, simply add the argument after the program path, separated by a space. For example, to open Outlook with a specific profile called "John Doe", you would use the following command:
START "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE" /profile "John Doe"Using the Call Command
If you are using the START command in a batch file, you may want to use the CALL command instead. This is because the START command opens a new command window, which can cause the batch file to close before the program has finished starting.
The CALL command allows you to run a command or batch file in the current window, so the batch file will wait for the program to finish starting before continuing. The syntax for the CALL command is as follows:
CALL <batch file or command>For example, to open Outlook from a batch file using the CALL command, you would use the following code:
CALL "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE"Using the Command Line to Send Emails
In addition to opening Outlook from the command line, you can also use it to send emails. This can be done by creating a new message in Outlook and then saving it as a draft.
To create a new message from the command line, you can use the following command:
"C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE" /c ipm.noteThis will open a new message window in Outlook. You can then use the command line to add recipients, a subject, and the body of the message. For example:
"C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE" /c ipm.note /m "[email protected]" /subject "Test Email" /body "Hello, this is a test email."Once you have added all of the necessary information, you can save the message as a draft.
- The START command can be used to open Outlook 365 from the command line.
- Command line arguments can be used to customize the way Outlook starts.
- The CALL command can be used in a batch file to open Outlook in the current command window.
- The command line can also be used to create and send emails in Outlook.
References
-
Command-line switches for Microsoft Office products (