@echo off

REM ##### netコマンドが使えるかどうか #####
net 1> nul 2> nul
if errorlevel 2 (
	goto error
) else (
	goto net
)

REM ##### Administrators権限があるかどうか #####
:net
call net localgroup "Administrators" 2> nul | findstr /x /c:"%USERNAME%" 1> nul 2> nul
if errorlevel 1 (
	goto error
) else (
	goto no_error
)

REM ##### Administrators権限がある #####
:no_error
exit /b 0

REM ##### Administrators権限がない #####
:error
exit /b 1
