@echo off
setlocal EnableExtensions EnableDelayedExpansion
:: ==========================================================
:: Red´s IFEO Manager v3.0
:: Image File Execution Options Manager
:: Author : ChatGPT & RedF
:: ==========================================================
title IFEO Manager v3.0
:: ----------------------------------------------------------
:: Administrator Check
:: ----------------------------------------------------------
net session >nul 2>&1
if %errorlevel% neq 0 (
echo.
echo =====================================================
echo Administrator privileges are required.
echo Restarting with elevation...
echo =====================================================
echo.
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
:: ----------------------------------------------------------
:: ANSI Colors
:: ----------------------------------------------------------
for /F %%a in ('echo prompt $E ^| cmd') do set "ESC=%%a"
set "RESET=%ESC%[0m"
set "GREEN=%ESC%[92m"
set "RED=%ESC%[91m"
set "YELLOW=%ESC%[93m"
set "CYAN=%ESC%[96m"
set "WHITE=%ESC%[97m"
set "GRAY=%ESC%[90m"
:: ----------------------------------------------------------
:: Global Variables
:: ----------------------------------------------------------
set VERSION=3.0
set APPNAME=IFEO Manager
set ROOT=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
set LOGFILE=%~dp0IFEO_Manager.log
set BACKUP=%~dp0Backups
if not exist "%BACKUP%" mkdir "%BACKUP%"
:: ----------------------------------------------------------
:: Create Log File
:: ----------------------------------------------------------
if not exist "%LOGFILE%" (
echo ===============================================>"%LOGFILE%"
echo IFEO Manager Log>>"%LOGFILE%"
echo ===============================================>>"%LOGFILE%"
)
call :Log IFEO Manager started.
goto MainMenu
:: ==========================================================
:: MAIN MENU
:: ==========================================================
:MainMenu
cls
echo.
echo %CYAN%==============================================================%RESET%
echo.
echo %WHITE%IFEO MANAGER v%VERSION%%RESET%
echo.
echo %CYAN%==============================================================%RESET%
echo.
echo [1] List configured executables
echo [2] Configure an executable
echo [3] Remove tweaks
echo [4] Check executable status
echo.
echo [5] Scan installed games
echo [6] Export configuration
echo [7] Import configuration
echo.
echo [8] Cleanup empty IFEO keys
echo [9] Settings
echo.
echo [A] About
echo.
echo [0] Exit
echo.
set CHOICE=
set /p CHOICE=Select an option :
if /I "%CHOICE%"=="1" goto ListExecutables
if /I "%CHOICE%"=="2" goto ConfigureMenu
if /I "%CHOICE%"=="3" goto RemoveMenu
if /I "%CHOICE%"=="4" goto CheckStatus
if /I "%CHOICE%"=="5" goto ScanGames
if /I "%CHOICE%"=="6" goto ExportConfig
if /I "%CHOICE%"=="7" goto ImportConfig
if /I "%CHOICE%"=="8" goto CleanupKeys
if /I "%CHOICE%"=="9" goto Settings
if /I "%CHOICE%"=="A" goto About
if "%CHOICE%"=="0" goto Exit
goto MainMenu
:: ==========================================================
:: LOG FUNCTION
:: ==========================================================
:Log
echo [%date% %time%] %*>>"%LOGFILE%"
exit /b
:: ==========================================================
call :Log Program closed.
cls
echo.
echo Thank you for using IFEO Manager.
echo.
timeout /t 2 >nul
exit
:: ==========================================================
:: CONFIGURE MENU
:: ==========================================================
:ConfigureMenu
cls
echo.
echo ==========================================================
echo Configure Executable
echo ==========================================================
echo.
echo Enter the executable name
echo Example: Cyberpuke.exe
echo.
echo Tip: You can also drag and drop an EXE onto this window.
echo.
set "EXE="
set /P EXE=Executable:
if "%EXE%"=="" goto MainMenu
:: Drag & Drop support
if exist "%EXE%" (
for %%I in ("%EXE%") do set "EXE=%%~nxI"
)
goto ConfigureSelection
:: ==========================================================
:: CONFIGURE SELECTION
:: ==========================================================
:ConfigureSelection
cls
echo.
echo ==========================================================
echo Configure: %EXE%
echo ==========================================================
echo.
echo [1] Enable UseLargePages
echo [2] Enable FrontEndHeapDebugOptions
echo [3] Enable BOTH tweaks
echo.
echo [4] Back
echo.
set "SEL="
set /P SEL=Choice:
if "%SEL%"=="1" goto EnableULP
if "%SEL%"=="2" goto EnableHeap
if "%SEL%"=="3" goto EnableBoth
if "%SEL%"=="4" goto MainMenu
goto ConfigureSelection
:: ==========================================================
:: REMOVE MENU
:: ==========================================================
:RemoveMenu
cls
echo.
echo ==========================================================
echo Remove Tweaks
echo ==========================================================
echo.
echo Enter executable name.
echo.
set "EXE="
set /P EXE=Executable:
if "%EXE%"=="" goto MainMenu
if exist "%EXE%" (
for %%I in ("%EXE%") do set "EXE=%%~nxI"
)
goto RemoveSelection
:: ==========================================================
:: REMOVE SELECTION
:: ==========================================================
:RemoveSelection
cls
echo.
echo ==========================================================
echo Remove Tweaks from %EXE%
echo ==========================================================
echo.
echo [1] Remove UseLargePages
echo [2] Remove FrontEndHeapDebugOptions
echo [3] Remove BOTH tweaks
echo.
echo [4] Back
echo.
set "SEL="
set /P SEL=Choice:
if "%SEL%"=="1" goto DisableULP
if "%SEL%"=="2" goto DisableHeap
if "%SEL%"=="3" goto DisableBoth
if "%SEL%"=="4" goto MainMenu
goto RemoveSelection
:: ==========================================================
:: BACKUP CURRENT IFEO KEY
:: ==========================================================
:BackupKey
set "STAMP=%DATE:~-4%%DATE:~3,2%%DATE:~0,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%"
set "STAMP=%STAMP: =0%"
reg export "%ROOT%\%EXE%" "%BACKUP%\%EXE%_%STAMP%.reg" /y >nul 2>&1
exit /b
:: ==========================================================
:: ENABLE USELARGEPAGES
:: ==========================================================
:EnableULP
call :BackupKey
reg add "%ROOT%\%EXE%" ^
/v UseLargePages ^
/t REG_DWORD ^
/d 1 ^
/f >nul
call :Log Enabled UseLargePages for %EXE%
echo.
echo %GREEN%UseLargePages enabled.%RESET%
echo.
pause
goto MainMenu
:: ==========================================================
:: ENABLE HEAP
:: ==========================================================
:EnableHeap
call :BackupKey
reg add "%ROOT%\%EXE%" ^
/v FrontEndHeapDebugOptions ^
/t REG_DWORD ^
/d 8 ^
/f >nul
call :Log Enabled FrontEndHeapDebugOptions for %EXE%
echo.
echo %GREEN%FrontEndHeapDebugOptions enabled.%RESET%
echo.
pause
goto MainMenu
:: ==========================================================
:: ENABLE BOTH
:: ==========================================================
:EnableBoth
call :BackupKey
reg add "%ROOT%\%EXE%" /v UseLargePages /t REG_DWORD /d 1 /f >nul
reg add "%ROOT%\%EXE%" /v FrontEndHeapDebugOptions /t REG_DWORD /d 8 /f >nul
call :Log Enabled BOTH tweaks for %EXE%
echo.
echo %GREEN%Both tweaks enabled.%RESET%
echo.
pause
goto MainMenu
:: ==========================================================
:: DISABLE USELARGEPAGES
:: ==========================================================
:DisableULP
call :BackupKey
reg delete "%ROOT%\%EXE%" ^
/v UseLargePages ^
/f >nul 2>&1
call :Log Disabled UseLargePages for %EXE%
echo.
echo %YELLOW%UseLargePages removed.%RESET%
echo.
pause
goto MainMenu
:: ==========================================================
:: DISABLE HEAP
:: ==========================================================
:DisableHeap
call :BackupKey
reg delete "%ROOT%\%EXE%" ^
/v FrontEndHeapDebugOptions ^
/f >nul 2>&1
call :Log Disabled FrontEndHeapDebugOptions for %EXE%
echo.
echo %YELLOW%FrontEndHeapDebugOptions removed.%RESET%
echo.
pause
goto MainMenu
:: ==========================================================
:: DISABLE BOTH
:: ==========================================================
:DisableBoth
call :BackupKey
reg delete "%ROOT%\%EXE%" /v UseLargePages /f >nul 2>&1
reg delete "%ROOT%\%EXE%" /v FrontEndHeapDebugOptions /f >nul 2>&1
call :Log Disabled BOTH tweaks for %EXE%
echo.
echo %YELLOW%Both tweaks removed.%RESET%
echo.
pause
goto MainMenu
:: ==========================================================
:: LIST CONFIGURED EXECUTABLES
:: ==========================================================
:ListExecutables
cls
echo.
echo ==========================================================
echo CONFIGURED EXECUTABLES
echo ==========================================================
echo.
set COUNT=0
for /f "skip=1 delims=" %%K in ('reg query "%ROOT%" 2^>nul') do (
set "KEY=%%K"
for %%A in ("%%K") do set "NAME=%%~nxA"
set /a COUNT+=1
echo ------------------------------------------------------
echo !COUNT!. !NAME!
reg query "%%K" /v UseLargePages >nul 2>&1
if !errorlevel!==0 (
echo %GREEN%[+] UseLargePages Enabled%RESET%
) else (
echo %RED%[-] UseLargePages Disabled%RESET%
)
reg query "%%K" /v FrontEndHeapDebugOptions >nul 2>&1
if !errorlevel!==0 (
echo %GREEN%[+] FrontEndHeapDebugOptions Enabled%RESET%
) else (
echo %RED%[-] FrontEndHeapDebugOptions Disabled%RESET%
)
)
if %COUNT%==0 (
echo No IFEO entries found.
)
echo.
pause
goto MainMenu
:: ==========================================================
:: CHECK STATUS
:: ==========================================================
:CheckStatus
cls
echo.
echo ==========================================================
echo CHECK EXECUTABLE STATUS
echo ==========================================================
echo.
echo Enter executable name.
echo Example: My-Little-Pony.exe
echo.
set EXE=
set /P EXE=Executable:
if "%EXE%"=="" goto MainMenu
if exist "%EXE%" (
for %%I in ("%EXE%") do set EXE=%%~nxI
)
cls
echo.
echo ==========================================================
echo Status for %EXE%
echo ==========================================================
echo.
if not exist "%BACKUP%" mkdir "%BACKUP%"
reg query "%ROOT%\%EXE%" >nul 2>&1
if errorlevel 1 (
echo %YELLOW%No IFEO key exists for this executable.%RESET%
echo.
pause
goto MainMenu
)
:: ----------------------------------------------------------
:: UseLargePages
:: ----------------------------------------------------------
reg query "%ROOT%\%EXE%" /v UseLargePages >nul 2>&1
if errorlevel 1 (
echo UseLargePages
echo %RED%Disabled%RESET%
) else (
for /f "tokens=3" %%A in ('reg query "%ROOT%\%EXE%" /v UseLargePages ^| find "UseLargePages"') do (
echo UseLargePages
echo %GREEN%Enabled%RESET%
echo Value : %%A
)
)
echo.
:: ----------------------------------------------------------
:: FrontEndHeapDebugOptions
:: ----------------------------------------------------------
reg query "%ROOT%\%EXE%" /v FrontEndHeapDebugOptions >nul 2>&1
if errorlevel 1 (
echo FrontEndHeapDebugOptions
echo %RED%Disabled%RESET%
) else (
for /f "tokens=3" %%A in ('reg query "%ROOT%\%EXE%" /v FrontEndHeapDebugOptions ^| find "FrontEndHeapDebugOptions"') do (
echo FrontEndHeapDebugOptions
echo %GREEN%Enabled%RESET%
echo Value : %%A
)
)
echo.
echo Registry Path
echo %ROOT%\%EXE%
echo.
pause
goto MainMenu
:: ==========================================================
:: SHOW COMPLETE REGISTRY VALUES
:: ==========================================================
:ShowRaw
cls
echo.
reg query "%ROOT%\%EXE%"
echo.
pause
goto MainMenu
:: ==========================================================
:: GAME SCANNER
:: ==========================================================
:ScanGames
cls
echo.
echo ==========================================================
echo Scanning for installed games...
echo ==========================================================
echo.
set "GAMEFILE=%TEMP%\ifeo_games.txt"
if exist "%GAMEFILE%" del "%GAMEFILE%"
:: ----------------------------------------------------------
:: STEAM
:: ----------------------------------------------------------
echo Scanning Steam...
if exist "%ProgramFiles(x86)%\Steam\steamapps\common" (
for /R "%ProgramFiles(x86)%\Steam\steamapps\common" %%F in (*.exe) do (
echo %%~fF>>"%GAMEFILE%"
)
)
:: ----------------------------------------------------------
:: EPIC
:: ----------------------------------------------------------
echo Scanning Epic Games...
if exist "%ProgramFiles%\Epic Games" (
for /R "%ProgramFiles%\Epic Games" %%F in (*.exe) do (
echo %%~fF>>"%GAMEFILE%"
)
)
:: ----------------------------------------------------------
:: GOG
:: ----------------------------------------------------------
echo Scanning GOG...
if exist "%ProgramFiles(x86)%\GOG Galaxy\Games" (
for /R "%ProgramFiles(x86)%\GOG Galaxy\Games" %%F in (*.exe) do (
echo %%~fF>>"%GAMEFILE%"
)
)
:: ----------------------------------------------------------
:: XBOX GAMES
:: ----------------------------------------------------------
echo Scanning Xbox Games...
if exist "C:\XboxGames" (
for /R "C:\XboxGames" %%F in (*.exe) do (
echo %%~fF>>"%GAMEFILE%"
)
)
:: ----------------------------------------------------------
:: NOTHING FOUND?
:: ----------------------------------------------------------
if not exist "%GAMEFILE%" (
echo.
echo No games found.
echo.
pause
goto MainMenu
)
goto GameList
:: ==========================================================
:: SHOW GAME LIST
:: ==========================================================
:GameList
cls
echo.
echo ==========================================================
echo Installed Games
echo ==========================================================
echo.
setlocal EnableDelayedExpansion
set COUNT=0
for /f "usebackq delims=" %%F in ("%GAMEFILE%") do (
set /a COUNT+=1
set GAME!COUNT!=%%F
for %%A in ("%%F") do (
echo !COUNT!. %%~nxA
)
)
echo.
echo 0. Cancel
echo.
set /P PICK=Select game:
if "%PICK%"=="0" (
endlocal
goto MainMenu
)
call set GAME=%%GAME%PICK%%%
if "%GAME%"=="" (
endlocal
goto GameList
)
for %%A in ("%GAME%") do (
set EXE=%%~nxA
)
endlocal
goto ConfigureSelection
:: ==========================================================
:: EXPORT CONFIGURATION
:: ==========================================================
:ExportConfig
cls
echo.
echo ==========================================================
echo EXPORT CONFIGURATION
echo ==========================================================
echo.
set "STAMP=%DATE:~-4%%DATE:~3,2%%DATE:~0,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%"
set "STAMP=%STAMP: =0%"
set "EXPORTFILE=%BACKUP%\IFEO_Backup_%STAMP%.reg"
echo Exporting...
reg export "%ROOT%" "%EXPORTFILE%" /y >nul
if errorlevel 1 (
echo.
echo %RED%Export failed.%RESET%
) else (
echo.
echo %GREEN%Export successful.%RESET%
echo.
echo %EXPORTFILE%
call :Log Exported configuration to %EXPORTFILE%
)
echo.
pause
goto MainMenu
:: ==========================================================
:: IMPORT CONFIGURATION
:: ==========================================================
:ImportConfig
cls
echo.
echo ==========================================================
echo IMPORT CONFIGURATION
echo ==========================================================
echo.
echo Enter full path to REG file.
echo.
set IMPORT=
set /P IMPORT=REG File:
if "%IMPORT%"=="" goto MainMenu
if not exist "%IMPORT%" (
echo.
echo %RED%File not found.%RESET%
echo.
pause
goto MainMenu
)
reg import "%IMPORT%"
if errorlevel 1 (
echo.
echo %RED%Import failed.%RESET%
) else (
echo.
echo %GREEN%Import completed successfully.%RESET%
call :Log Imported configuration from %IMPORT%
)
echo.
pause
goto MainMenu
:: ==========================================================
:: CREATE FULL BACKUP
:: ==========================================================
:CreateBackup
set "STAMP=%DATE:~-4%%DATE:~3,2%%DATE:~0,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%"
set "STAMP=%STAMP: =0%"
set LASTBACKUP=%BACKUP%\IFEO_LastBackup.reg
reg export "%ROOT%" "%LASTBACKUP%" /y >nul
exit /b
:: ==========================================================
:: RESTORE LAST BACKUP
:: ==========================================================
:RestoreBackup
cls
echo.
echo ==========================================================
echo RESTORE LAST BACKUP
echo ==========================================================
echo.
if not exist "%BACKUP%\IFEO_LastBackup.reg" (
echo No backup available.
echo.
pause
goto MainMenu
)
choice /M "Restore the last backup"
if errorlevel 2 goto MainMenu
reg import "%BACKUP%\IFEO_LastBackup.reg"
if errorlevel 1 (
echo.
echo %RED%Restore failed.%RESET%
) else (
echo.
echo %GREEN%Restore successful.%RESET%
call :Log Restored last backup
)
echo.
pause
goto MainMenu
:: ==========================================================
:: VIEW LOG
:: ==========================================================
:ViewLog
cls
echo.
echo ==========================================================
echo LOG FILE
echo ==========================================================
echo.
if exist "%LOGFILE%" (
type "%LOGFILE%"
) else (
echo No log file exists.
)
echo.
pause
goto MainMenu
:: ==========================================================
:: CLEAR LOG
:: ==========================================================
:ClearLog
cls
echo.
echo ==========================================================
echo CLEAR LOG
echo ==========================================================
echo.
choice /M "Delete log file"
if errorlevel 2 goto MainMenu
del "%LOGFILE%" >nul 2>&1
echo.
echo %GREEN%Log deleted.%RESET%
echo ===============================================>"%LOGFILE%"
echo IFEO Manager Log>>"%LOGFILE%"
echo ===============================================>>"%LOGFILE%"
echo.
pause
goto MainMenu
:: ==========================================================
:: CLEANUP EMPTY IFEO KEYS
:: ==========================================================
:CleanupKeys
cls
echo.
echo ==========================================================
echo CLEANUP EMPTY IFEO KEYS
echo ==========================================================
echo.
choice /M "Remove empty IFEO registry keys"
if errorlevel 2 goto MainMenu
set COUNT=0
for /f "skip=1 delims=" %%K in ('reg query "%ROOT%" 2^>nul') do (
reg query "%%K" /v UseLargePages >nul 2>&1
set ULP=!errorlevel!
reg query "%%K" /v FrontEndHeapDebugOptions >nul 2>&1
set HEAP=!errorlevel!
if "!ULP!!HEAP!"=="11" (
reg delete "%%K" /f >nul 2>&1
set /a COUNT+=1
echo Removed:
echo %%~nxK
call :Log Removed empty IFEO key %%~nxK
)
)
echo.
echo Finished.
echo.
echo Keys removed: %COUNT%
echo.
pause
goto MainMenu
:: ==========================================================
:: SETTINGS
:: ==========================================================
:Settings
cls
echo.
echo ==========================================================
echo SETTINGS
echo ==========================================================
echo.
echo [1] View Log
echo [2] Clear Log
echo [3] Restore last backup
echo.
echo [0] Back
echo.
set SEL=
set /P SEL=Choice:
if "%SEL%"=="1" goto ViewLog
if "%SEL%"=="2" goto ClearLog
if "%SEL%"=="3" goto RestoreBackup
if "%SEL%"=="0" goto MainMenu
goto Settings
:: ==========================================================
:: ABOUT
:: ==========================================================
:About
cls
echo.
echo ==========================================================
echo IFEO MANAGER
echo ==========================================================
echo.
echo Version : %VERSION%
echo.
echo Image File Execution Options Manager
echo.
echo Supported Tweaks
echo ----------------
echo.
echo * UseLargePages
echo * FrontEndHeapDebugOptions (0x08)
echo.
echo Features
echo --------
echo.
echo * Automatic Administrator Elevation
echo * Registry Backup
echo * Import / Export
echo * Game Scanner
echo * Logging
echo * Drag and Drop Support
echo * IFEO Cleanup
echo.
echo Registry Root
echo.
echo %ROOT%
echo.
echo Log File
echo.
echo %LOGFILE%
echo.
echo Backup Folder
echo.
echo %BACKUP%
echo.
ver
echo.
pause
goto MainMenu
:Exit
:: ==========================================================
:: END OF FILE
:: ==========================================================