Open up a Command Prompt.
Then you just need to use the command below that matches your OS.
For 32 bit Windows:
cscript "C:\Program Files\Microsoft Office\Office15\OSPP.VBS" /inpkey:NEWKEY
For 64 bit Windows (assuming you are using 32 bit Office):
cscript "C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS" /inpkey:NEWKEY
Those commands are for Office 2013.For Office 2016, just replace “Office15” by “Office16”.