如何使用VBscript导航Windows注册表树 [英] How to navigate Windows registry tree with VBscript

查看:62
本文介绍了如何使用VBscript导航Windows注册表树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人需要走树时有人知道如何导航Windows注册表吗?如何找到节点(键)的子级?

我有 此示例在C .我有WScript.Shell的RegRead方法.我不确定该如何进行.

我最终的目标是删除注册表的整个子树.我发现如果给定以斜杠结尾的键路径,如果树不为空,则RegDelete会引发异常.因此,我认为我需要先进行深度优先遍历并删除.

解决方案

 "   WScript.Shell")
mykey = " 
WshShell.RegDelete mykey 


尾随的\将删除所有子节点的条目.

或检查此. http://www.tek-tips.com/viewthread.cfm?qid=674375 [ ^ ]


http://technet.microsoft.com/en-us/library/bb742376.aspx [ ^ ]

Does anyone know how to go about navigating the Windows registry when you need to walk the tree? How can I find the children of a node(key)?

I have this example in C. I have the WScript.Shell''s RegRead method. I am not sure how to proceed.

My eventual target is to delete an entire subtree of the registry. I found that RegDelete throws an exception if the tree is not empty when I give a key path ending in a slash. So, I think I need to do a depth-first traversal and delete as I unwind.

解决方案

Set WshShell = WScript.CreateObject("WScript.Shell")
mykey = "HKEY_LOCAL_MACHINE\SOFTWARE\mykey\"
WshShell.RegDelete mykey 


The trailing \ will delete entry with all child nodes.

Or check this. http://www.tek-tips.com/viewthread.cfm?qid=674375[^]


http://technet.microsoft.com/en-us/library/bb742376.aspx[^]


这篇关于如何使用VBscript导航Windows注册表树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆