Hi,
You want a KMS server to allow you to automatically activate 8.1 with a KMS key.
This in a batch file will replace the KEY to either a KMS (recommended) or MAK:
@echo off
cls
echo Activating Windows ... Please wait as this might take several minutes...
echo.
cscript //B "%windir%\system32\slmgr.vbs" /ipk <put ya dummy KMS key in here with dashes>
cscript //B "%windir%\system32\slmgr.vbs" /ato
echo Activation complete!