setlocal enabledelayedexpansion
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
chcp 65001 >nul
@echo off
cscript //nologo %windir%\system32\slmgr.vbs /upk
cscript //nologo %windir%\system32\slmgr.vbs /cpky
cscript //nologo %windir%\system32\slmgr.vbs /rearm
echo 5秒后自动重启，按任意键取消...
powershell -Command "$t=5; $s=[DateTime]::Now; while(([DateTime]::Now-$s).TotalSeconds -lt $t){if([Console]::KeyAvailable){exit 1}}; exit 0"
if errorlevel 1 exit /b
shutdown /r /t 0
del %0