Thanks to TazDevilLooney, but I can't get that code to work for me. It doesn't pass any arguments when relaunched elevated.
This is probably a more robust way of checking permissions:
whoami /groups | find "S-1-16-12288" >nul
if "%errorlevel%"=="0" (
) else (
echo not elevated