删除使用删除章注册表项

编程入门 行业动态 更新时间:2024-10-27 04:25:07
本文介绍了删除使用删除章注册表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在一个批处理命令用来删除注册表值章删除。我遇到的问题是,我无法删除该值。下面是我想:

I am trying to delete registry values using reg delete in a batch command. The problem I am having is that I can't delete the value. Here is what I am trying:

REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports\" /v C:\convertdoc\output\SilentPrintTemp\126017829image-gif3.ps

在理想情况下,我想删除与所有条目:

Ideally I wanna remove all entries with:

REG DELETE "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports\" /v C:\convertdoc\output\SilentPrintTemp\*.ps

我在几个不同的方法和不同的参数尝试过。通常的双,在键的末端停止该命令。所以,也许我的语法有错吗?

I have tried it in a few different ways and with different parameters. Normally the double "" stops the command at the end of the key. So maybe my syntax is wrong?

推荐答案

编辑:

与的.bat 扩展名保存这并运行它:

Save this with a .bat extension and run it:

@echo off setlocal set "ports=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports" rem get only the first token of each line of "reg query" for /f %%I in ( 'reg query "%ports%"' ) do ( echo(%%I | findstr /i "c:\\convertdoc\\output\\silentprinttemp\\.*\.ps" >NUL && ( rem (if "findstr" didn't exit with an abnormal error code) echo Deleting item %%I reg delete "%ports%" /v "%%I" /f ) )

更多推荐

删除使用删除章注册表项

本文发布于:2023-11-03 14:34:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555374.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:注册表

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!