echo Run as administrator
if not "%1"=="UAC" (
powershell start '%~dpnx0' -verb runas -arg 'UAC'
exit /b
)
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
$scriptPath = $MyInvocation.MyCommand.Path
$arguments = "-NoProfile -ExecutionPolicy Bypass -File `"$scriptPath`""
Start-Process powershell -ArgumentList $arguments -Verb RunAs
Exit
}