@echo off
SETLOCAL ENABLEEXTENSIONS

:: 查找包含Cheat Engine键的注册表路径
for /f "tokens=*" %%a in ('reg query HKU ^| findstr /R "S-1-5-21-[0-9]*-[0-9]*-[0-9]*-[0-9]*$"') do (
    echo Found: %%a
    call :processKey %%a
)
goto :eof

:processKey
:: 检查并删除找到的Cheat Engine键
set key=%1\SOFTWARE\Cheat Engine
reg query "%key%" >nul 2>&1
if %errorlevel%==0 (
    echo Deleting: %key%
    reg delete "%key%" /f
) else (
    echo Not found: %key%
)
goto :eof
