KMS

Activate a Windows Operating System: Windows 7, Windows 8, Server 2008, Server 2008 R2, or Server 2012:
Open up an Elevated Command Prompt window. For instructions, please see our guide: How To Open an Elevated Command Prompt.
In the elevated Command Prompt window, verify that the current directory is C:\Windows\System32. If it is not, type
CD \Windows\System32
and press Enter.
Type the following command:
cscript slmgr.vbs /skms kms01.cit.cornell.edu
and press Enter.
(Note: The url in the command above begins with kay-emm-ess-zero-one.)
Type the following command:
cscript slmgr.vbs /ato
and press Enter.
Close the Command Prompt window.
And you’re done for that installation of Windows on that computer.

Activate Microsoft Office (2016, 2013, or 2010)
Open an Elevated Command Prompt window. For instructions, please see our guide How To Open an Elevated Command Prompt.
Type the following command, depending on your version of Office:
Office 2016:
CD \Program Files\Microsoft Office\Office16
Press Enter. This assumes you installed Office in the default location.
Note: If you installed the 32-bit version of Office on a 64-bit system, use this command instead:
CD \Program Files (x86)\Microsoft Office\Office16
Office 2013:
CD \Program Files\Microsoft Office\Office15
Press Enter. This assumes you installed Office in the default location.
Note: If you installed the 32-bit version of Office on a 64-bit system, use this command instead:
CD \Program Files (x86)\Microsoft Office\Office15
Office 2010:
CD \Program Files\Microsoft Office\Office14
Press Enter. This assumes you installed Office in the default location.
Note: If you installed the 32-bit version of Office on a 64-bit system, use this command instead:
CD \Program Files (x86)\Microsoft Office\Office14
Type the following command:
cscript ospp.vbs /sethst:kms01.cit.cornell.edu
and press Enter. (Note: The url in the command above begins with kay-emm-ess-zero-one.)
Type the following command:
cscript ospp.vbs /act
and press Enter.
Close the command prompt window.