Ok, this script works as long as there are no subkeys. Is there a way to have VBScript delete the key, and all of its values and subkeys in one swoop?


Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap"
strKeyName = "Domains"
objRegistry.GetStringValue HKEY_CURRENT_USER,strKeyPath,strKeyName
If IsNull(strKeyName) Then
WScript.Quit
Else
objRegistry.DeleteKey HKEY_CURRENT_USER,strKeyPath,strKeyName
WScript.Quit(1)
End If
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Take a look at this article. It's also got code to download
http://technet.microsoft.com/en-us/magazine/cc160952.aspx
Answered 03/07/2008 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
Hey, those sneaky guys added to the article. I only found this http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar05/hey0304.mspx in the archive. Thanks!
Answered 03/07/2008 by: bdog
Senior Yellow Belt

Please log in to comment
2
ORIGINAL: bdog

Hey, those sneaky guys added to the article. I only found this http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar05/hey0304.mspx in the archive. Thanks!


You're welcome, bdog. Now where's my ratings points? :-) JKJK
-would be nice though

-O
Answered 04/18/2008 by: aogilmor
Ninth Degree Black Belt

Please log in to comment
0
Thanks for the followup! You've been rated.
Answered 04/18/2008 by: bdog
Senior Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity