Microsoft provides a command-line tool called officec2rclient.exe (also known as the Office C2R Client) that can be used to activate Office 365. This tool is usually used for Click-to-Run (C2R) installations.
: