@echo off setlocal enabledelayedexpansion :: 用于删除注册表中layout的信息 set "inifile=./language/language.ini" set "section=[LAN]" set "key=LAN" set "found_section=false" for /f "usebackq tokens=* delims=" %%A in ("%inifile%") do ( set "line=%%A" :: 去除行前后的空格 set "line=!line: =!" if /i "!line!"=="%section%" ( set "found_section=true" ) else if "!line:~0,1!"=="[" ( set "found_section=false" ) if "!found_section!"=="true" ( for /f "tokens=1,* delims==" %%B in ("!line!") do ( if /i "%%B"=="%key%" ( set "value=%%C" ) ) ) ) :: 读取语言信息 set "fullSection=睿能绣花制版软件" if "%value%" == "0" ( :: 英语 set "fullSection=Raynen Embroidery Design Software" ) else if "%value%" == "13" ( :: 日语 set "fullSection=睿能绣花制版软件" ) echo 正在查找注册表项目... %fullSection% set found=0 :: 遍历 HKEY_CURRENT_USER\Software 下的所有一级子项 for /f "tokens=*" %%A in ('reg query "HKCU\Software" 2^>nul') do ( set "subkey=%%~nxA" :: 跳过已知容易卡死的分支 if /i "!subkey!"=="AppDataLow" ( echo . ) else if /i "!subkey!"=="Classes" ( echo . ) else ( reg query "%%A" /f "%fullSection%" /k 2>nul | findstr /i "%fullSection%" >nul if !errorlevel! == 0 ( reg delete "%%A\%fullSection%" /f set found=1 ) ) ) echo 清除完毕 pause endlocal