标题: [注册表类] 批处理删除注册表带有方正字体的键值需要模糊保留方正楷体、黑体、仿宋、书宋 [打印本页]
作者: 1508525251 时间: 2023-11-28 17:31 标题: 批处理删除注册表带有方正字体的键值需要模糊保留方正楷体、黑体、仿宋、书宋
- @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大佬),但是模糊保留带有方正楷体、方正黑体、方正仿宋、方正书宋的键值怎么都不成功,新手小白请教各位大佬如何修改这个脚本。
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |