@echo off
setlocal

set "EXE_NAME=eurotrucks2.exe"
set "EXE_PATH=%~dp0%EXE_NAME%"
if not exist "%EXE_PATH%" (
    echo Error: Euro Truck Simulator 2 does not exist.
) else (
    reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%EXE_PATH%" /t REG_SZ /d "RUNASADMIN" /f
    if %ERRORLEVEL%==0 (
        echo Successfully set Euro Truck Simulator 2 to run as administrator.
    ) else (
        echo Failed to set Euro Truck Simulator 2 to run as administrator.
    )
)

set "EXE_NAME=amtrucks.exe"
set "EXE_PATH=%~dp0%EXE_NAME%"
if not exist "%EXE_PATH%" (
    echo Error: American Truck Simulator does not exist.
) else (
    reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%EXE_PATH%" /t REG_SZ /d "RUNASADMIN" /f
    if %ERRORLEVEL%==0 (
        echo Successfully set American Truck Simulator to run as administrator.
    ) else (
        echo Failed to set American Truck Simulator to run as administrator.
    )
)
pause
endlocal