@echo off
:: Patch for ET Ready Package
:: Updates shortcuts with run as admin
:: 2013, SAS|GuNer
:: For Windows 8 mainly, but works on 7 and Vista also
:: No need to run on XP or lower
Title "ET Run As Admin"
COLOR 17
pushd %~dp0
echo. 
:: OLD OS CHK
ver | find "XP" > nul
if %ERRORLEVEL% == 0 goto not_sup
) ELSE ( 
ver | find "2000" > nul
if %ERRORLEVEL% == 0 goto not_sup
) ELSE ( 
ver | find "NT" > nul
if %ERRORLEVEL% == 0 goto not_sup
) ELSE ( 
ver | find "ME" > nul
if %ERRORLEVEL% == 0 goto not_sup
) ELSE ( 
ver | find "98" > nul
if %ERRORLEVEL% == 0 goto not_sup
) ELSE ( 
ver | find "95" > nul
if %ERRORLEVEL% == 0 goto not_sup
) ELSE ( 
goto continue 

:not_sup
cls
echo.
echo. Sorry, this OS is not supported
echo. 
echo.
echo.
echo.
echo.
echo.
echo.
echo.
pause
cls
exit

:continue 
echo. *********************************
echo.         ET Ready Update
echo. *********************************
echo. 
echo. desktop shortcut should be named one of these...
echo.
echo.       1.  Enemy Territory
echo.       2.  Wolfenstein - Enemy Territory
echo.       3.  ET
echo. 
echo.
echo. please wait...
PING -n 10 127.0.0.1>nul
cls
echo. *********************************
echo.         ET Ready Update
echo. *********************************
echo. 
echo. Patching ET shortcuts...
echo. 
PING -n 2 127.0.0.1>nul
cscript.exe /nologo /b "Win8RunAsAdmin.vbe" "%userprofile%\Desktop\Enemy Territory.lnk" >nul 2>nul
cscript.exe /nologo /b "Win8RunAsAdmin.vbe" "%userprofile%\Desktop\ET.lnk" >nul 2>nul
cscript.exe /nologo /b "Win8RunAsAdmin.vbe" "%userprofile%\Desktop\Wolfenstein - Enemy Territory.lnk" >nul 2>nul
cscript.exe /nologo /b "Win8RunAsAdmin.vbe" "%UserProfile%\Start Menu\Programs\Wolfenstein - Enemy Territory\Enemy Territory.lnk" >nul 2>nul
cscript.exe /nologo /b "Win8RunAsAdmin.vbe" "%UserProfile%\Start Menu\Programs\Wolfenstein - Enemy Territory\Wolfenstein - Enemy Territory.lnk" >nul 2>nul
PING -n 2 127.0.0.1>nul
echo. 
cls
echo. *********************************
echo.         ET Ready Update
echo. *********************************
echo. 
echo. Complete!
echo. 
echo. 
PING -n 3 127.0.0.1>nul
cls
echo. *********************************
echo.         ET Ready Update
echo. *********************************
echo. 
echo. exiting...
echo. 
PING -n 3 127.0.0.1>nul
cls
exit