- @echo off
- set "RegKey=HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
- set "RegKey1=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
- set "StrKey=方正"
- for /f "tokens=*" %%i in ('reg query "%RegKey%" ^| findstr /i /c:"%StrKey%"') do (
- set "StrFull=%%i"
- setlocal enabledelayedexpansion
- set "StrSuffix=!StrFull:* REG_SZ=!"
- call set "ValueName=%%StrFull: REG_SZ!StrSuffix!=%%"
- reg delete "%RegKey%" /v "!ValueName!" /f
- endlocal
- )
- for /f "tokens=*" %%i in ('reg query "%RegKey1%" ^| findstr /i /c:"%StrKey%"') do (
- set "StrFull=%%i"
- setlocal enabledelayedexpansion
- set "StrSuffix=!StrFull:* REG_SZ=!"
- call set "ValueName=%%StrFull: REG_SZ!StrSuffix!=%%"
- reg delete "%RegKey1%" /v "!ValueName!" /f
- endlocal
- )
- pause
复制代码 模糊删除方正的脚本我按照Batcher的帖子修改出来了(感谢Batcher大佬),但是模糊保留带有方正楷体、方正黑体、方正仿宋、方正书宋的键值怎么都不成功,新手小白请教各位大佬如何修改这个脚本。 |