Open CMD as Administrator (elevated).
cd /d %systemroot%\system32
cscript slmgr.vbs /inpkey:XXXXX-YYYYY...
cscript slmgr.vbs /ato
Windows 10/2016/2019:
cd /d %systemroot%\system32
cscript slmgr.vbs /ipk XXXXX-YYYYY...
Good luck.
Open CMD as Administrator (elevated).
cd /d %systemroot%\system32
cscript slmgr.vbs /inpkey:XXXXX-YYYYY...
cscript slmgr.vbs /ato
Windows 10/2016/2019:
cd /d %systemroot%\system32
cscript slmgr.vbs /ipk XXXXX-YYYYY...
Good luck.