如何找到/在注册表根据它的值删除的字符串值 [英] How to find/delete a string value in the registry based on its value
本文介绍了如何找到/在注册表根据它的值删除的字符串值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想写,将采取一个给定的键,搜索基于内容的字符串值,然后将其删除.reg文件。
例如:
I am trying to write a .reg file that would take a given key, and search for a string value based on its contents, and then delete it. For example:
[path]
"a"="b"
"z"="y"
"foo"="bar"
和不知何故知道无论是巴,也就是一个子删除值富。
这可能吗?
我需要做一个蝙蝠脚本(这是很好的,顺便说一句)?
And somehow delete the value "foo" by knowing either "bar" or a substring of that. Is this possible? Would I need to do this in a .bat script (which is fine, btw)?
推荐答案
尝试这一个BAT文件
SET KEY=HKLM\Software\MySoftware\Path
SET VALUE=BAR
for /F "tokens=1,*" %%a in ('REG QUERY "%KEY%" ^| findstr /I /C:"%VALUE%"') do (echo REG DELETE "%KEY%" /v %%a)
和经过加时赛仔细测试中的回声。
and after extra careful testing remove the ECHO.
这篇关于如何找到/在注册表根据它的值删除的字符串值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文